Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
JustinN
Level I

Using Col Sum to return certain value for all row

Capture.JPG

I want to creat a new colum ":Resuts Test 1" that will return the sum of all value in the :Results column that has a corresponding 1 in the :Test column. Im using the formula col sum(:Results,:Test) and the above image is what I"m getting. What i want is to have the sum of result for test 1 to be across all the rows, as shown in the below picture. 

Capture 2.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: Using Col Sum to return certain value for all row

This should work:

col sum(If(:Test == 1, :Results, . ) );
Jim

View solution in original post

3 REPLIES 3
Highlighted
pauldeen
Level IV

Re: Using Col Sum to return certain value for all row

How about you right click on one of the cells with the value you like and select Fill -> Fill to end of table
Highlighted
txnelson
Super User

Re: Using Col Sum to return certain value for all row

This should work:

col sum(If(:Test == 1, :Results, . ) );
Jim

View solution in original post

Highlighted
cwillden
Super User

Re: Using Col Sum to return certain value for all row

This column formula will do what you want.

test1rows = Current Data Table() << Get Rows Where( :Test == 1 );
Sum( :Results[test1rows] );

**I just saw Jim's solution and it is better 

-- Cameron Willden
Article Labels

    There are no labels assigned to this post.