Ok, all you Saved Search Mavens out there, I'm try...
# general
r
Ok, all you Saved Search Mavens out there, I'm trying to do a formula (text) field where the following custom item field is an integer value.
CASE WHEN {custitemquantity_free_ship_customer} =1 THEN 'ShipsFree' ELSE {custitemquantity_free_ship_customer} END
if I pull it by itself, it works fine, but if I try to do a Case/When statement on it, it fails as "Invalid Expression". Does anyone have any insight?
m
does it matter that {custitemquantity_free_ship_customer} returns an integer (in the case where it's not 1) whereas the formula is text?
g
That's probably it. try
ELSE TO_CHAR({custitemquantity_free_ship_customer})
r
after messing with it back and forth... turns out the "proper" form of this formula is
CASE WHEN ({custitemquantity_free_ship_customer} = '1') THEN 'ShipsFree' ELSE {custitemquantity_free_ship_customer} END
For whatever reason... parenthesis helped it work along with putting the value in quotes.
final version of the formula
CASE WHEN ({custitemquantity_free_ship_customer} = '1') THEN 'ShipsFree' ELSE ( CASE WHEN ({custitemquantity_free_ship_customer} >= '2')  THEN CONCAT({custitemquantity_free_ship_customer}, 'SqFtShipsFree')  ELSE  ' ' END ) END