Netsuite 嵌套的情况下

Netsuite 嵌套的情况下,netsuite,case-when,Netsuite,Case When,在Netsuite保存的搜索中,我无法在超过9999.99磅的订单上显示“16天交货”。第一部分的工作超过150.99罚款。我错过了什么 CASE WHEN{custcol_item_weight}*{quantity}>'150.99' THEN '8 Day Delivery' WHEN {custcol_item_weight}*{quantity}>'9999.99' THEN '16 Day Delivery' ELSE '4 Day Delivery' END 任何大于

在Netsuite保存的搜索中,我无法在超过9999.99磅的订单上显示“16天交货”。第一部分的工作超过150.99罚款。我错过了什么

CASE WHEN{custcol_item_weight}*{quantity}>'150.99' THEN '8 Day Delivery' WHEN {custcol_item_weight}*{quantity}>'9999.99' THEN '16 Day Delivery' ELSE '4 Day Delivery' END

任何大于9999.99的值也将大于150.99,因此第二个
when
子句将永远不会被命中。对于第一项,应检查该值是否也不大于9999.99:

CASE WHEN {custcol_item_weight}*{quantity} > '150.99' AND {custcol_item_weight}*{quantity} < '9999.99'THEN '8 Day Delivery' 
     WHEN {custcol_item_weight}*{quantity} > '9999.99' THEN '16 Day Delivery' 
     ELSE '4 Day Delivery' 
END
当{custcol\u item\u weight}*{quantity}>'150.99'和{custcol\u item\u weight}*{quantity}<'9999.99'然后是'8天交货'
当{custcol_item_weight}*{quantity}>'9999.99'时,则为'16天交货'
其他“4天交货”
终止

当案例条件重叠时(大于9999.99的数字也大于150.99),满足的第一个条件确定返回值。对于您的用例,首先捕获具有最高值的条件:

CASE 
WHEN {custcol_item_weight}*{quantity} > '9999.99' THEN '16 Day Delivery' 
WHEN {custcol_item_weight}*{quantity} > '150.99' THEN '8 Day Delivery' 
ELSE '4 Day Delivery' 
END