Aggregated NetSuite Criteria Results

69 views Asked by At

I have this formula to give me an aggregated results or one of the possibilities in the CASE statement to be grouped by the KEEP statement. Is this formulatically correct? I keep getting an error when trying to process it under as a text formula and numeric. I've tried it both ways with both formulas.

CASE WHEN {transaction.type} = 'Invoice' AND TO_CHAR({transaction.taxtotal} != {transaction.amountremaining}) OR TO_CHAR({transaction.amountremaining} < 25) OR {transaction.custbody_wh} = 'F' THEN KEEP(DENSE_RANK FIRST ORDER BY {transaction.mainname}) ELSE NULL END

CASE WHEN {transaction.type} = 'Invoice' AND {transaction.taxtotal} != {transaction.amountremaining} OR {transaction.amountremaining} < 25 OR {transaction.custbody_wh} = 'F' THEN KEEP(DENSE_RANK FIRST ORDER BY {transaction.mainname}) ELSE NULL END

1

There are 1 answers

0
ap-dataSci On

try this?

CASE WHEN {transaction.type} = 'Invoice' AND {transaction.taxtotal} != {transaction.amountremaining} OR {transaction.amountremaining} < 25 OR {transaction.custbody_wh} = 'F' THEN FIRST({transaction.mainname}) KEEP(DENSE_RANK FIRST ORDER BY {transaction.mainname}) ELSE NULL END