RE: Return 20 if formula value is higher than 20 else return formula value

Hello,

I have the below formula. If the result is greater than 20 I want it to return 20 else return the value from the formula.

CASE WHEN {memberitem.inventorylocation} = ‘Warehouse 1’ AND {type} = ‘Kit/Package’ THEN {memberitem.locationquantityavailable} WHEN {inventorylocation} = ‘Warehouse 1’ THEN {locationquantityavailable} END

Appreciate the help.

Jm1982 Rookie Asked on September 27, 2021 in Saved Searches.
Add Comment
2 Answers

Hi

I have not tried it yet in NetSuite but  Oracle allows nested CASE operators so you could try :

CASE
WHEN 
CASE
WHEN {memberitem.inventorylocation} = ‘Warehouse 1’ AND {type} = ‘Kit/Package’ THEN {memberitem.locationquantityavailable} WHEN {inventorylocation} = ‘Warehouse 1’ THEN  {locationquantityavailable}
END  < 20 THEN CASE
WHEN {memberitem.inventorylocation} = ‘Warehouse 1’ AND {type} = ‘Kit/Package’ THEN {memberitem.locationquantityavailable} WHEN {inventorylocation} = ‘Warehouse 1’ THEN  {locationquantityavailable}
END
ELSE 20
END

Cheers

 

Edo Aroni

Beginner Answered on September 27, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.