BookmarkSubscribeRSS Feed
jameskim

Community Trekker

Joined:

May 17, 2012

About fomula. col sum by customer name

Hello. Could you do me a faver?

I know how can I use FOMULA function to calculate sum of column .

Col Sum(:ASSY_IN_QTY)

Furthermore, I want to calculate sum of column by cust (customer name)

2037_Col sum.jpg

I want to make script more simply from your answer.

Thanks.

dt << New Column( "Col Sum by customer",

Numeric,

Continuous,

formula(

Col Sum(:ASSY_IN_QTY)

)

);

1 ACCEPTED SOLUTION

Accepted Solutions
ms

Super User

Joined:

Jun 23, 2011

Solution

Re: About fomula. col sum by customer name

Col Sum() can have optional By-arguments. In the formula editor select the first argument and click on the ^ button to reveal the placeholder and select a by-column.

In JSL it can look like this:

dt << New Column( "Col Sum by customer",

Numeric,

Continuous,

formula(

Col Sum(:ASSY_IN_QTY, :CUST)

)

);

1 REPLY
ms

Super User

Joined:

Jun 23, 2011

Solution

Re: About fomula. col sum by customer name

Col Sum() can have optional By-arguments. In the formula editor select the first argument and click on the ^ button to reveal the placeholder and select a by-column.

In JSL it can look like this:

dt << New Column( "Col Sum by customer",

Numeric,

Continuous,

formula(

Col Sum(:ASSY_IN_QTY, :CUST)

)

);