Jeremy Larson
Jeremy Larson

Reputation: 59

netsuite case when formula

I am trying to make it so that when I have a case that either has Multiple Sales orders or multiple items on a sales order that it will tell me Multiple SOs on all of the lines.. So far the case formula code that I have will put it on some of the SOs but not all of them. it always skips some.

The end result is so that we know that there is multiple sales orders associated with that case.. This will allow us to know to look for tracking for each sales order.

CASE WHEN dense_RANK() OVER (PARTITION by {custbody_case.number} ORDER BY {internalid})>1 THEN 'MULTIPLE SOs 1

Case:'||{custbody_case.number}||'' WHEN dense_RANK() OVER (PARTITION by {number} ORDER BY {internalid})>1 THEN 'MULTIPLE SOs 3

Case:'||{custbody_case.number}||'' WHEN dense_RANK() OVER (PARTITION by {custbody_case.number} ORDER BY {number})>1 THEN 'MULTIPLE SOs 4

Case:'||{custbody_case.number}||'' ELSE 'Case:'||{custbody_case.number}||'

' END

Script

Image

Upvotes: 0

Views: 484

Answers (1)

Nathan Sutherland
Nathan Sutherland

Reputation: 1260

RANK cannot take the place of COUNT. You can use analytic count by placing a comment between the function name and opening parentheses COUNT/*...*/(

You can also use NetSuite's grouping and utilize agragate COUNT inside a Minimum, Maximum, or Average

Upvotes: 1

Related Questions