Search code examples
netsuitecase-statementsaved-searches

Combining two separate case statements in NetSuite Case Statements


I currently have two separate saved search columns for these two statements, and I'm hoping to combine them and list the data in just one column. I've tried OR AND, but the results then error out.

First Statement Case when {item.custitem54} is null then {quantity} else null end

Second Statement Case when {item.custitem54} = 'Yes' and {shipdate} between to_date('05/25/2020', 'MM/DD/YYYY') and to_date('12/25/2020', 'MM/DD/YYYY') then {quantity} else null end


Solution

  • You can have multiple WHEN in a case statement. The first matched WHEN determines the result unless it gets to the ELSE.

    Case when {item.custitem54} = 'Yes' 
              and {shipdate} between date '2020-05-25' and date '2020-12-25' then {quantity} 
         when {item.custitem54} is null then {quantity} 
         else null 
    end