hello, I am doing a Formula(date) in a saved searc...
# suiteanalytics
k
hello, I am doing a Formula(date) in a saved search so that if the transaction type is a sales order, I would like to get the Transaction date, if not I would like to leave it blank. Here is what I have
CASE WHEN {transaction.type} = 'Sales Order' THEN {transaction.trandate} ELSE '' END
However, I keep on getting invalid expression error. I think my else condition is failing. is there a way to resolve this?
p
I just tried the following with a transaction saved search & it's fine:
case when {type}='Sales Order' then {trandate} else NULL end
I suspect in your case it is
''
being a string that is returned, rather than a date
k
thank you! that was it!
w
tip: replace {type} = 'Sales Order' with {type.id} = 'SalesOrd' for a more robust search. In case someone uses another language.
👍 1