cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
bzanos
Level III

JSL to create a column that is a cumulative sum based on previous row of other columns

I am using JMP Pro 12.

I need help to create a new column ('cum_Qty') in JSL that will be an ongoing sum of the previous rows value in 'Qty'column until meet => 500. If the row qty is => 500 in , the value will update as it in the 'cum_Qty'. 

 

Example:

In workweek 2, the qty is 633 (> 500) in 'Qty'column, this value is updated as 633 in 'çum_Qty' column.

In workweek 3, the qty is 185 (< 500), it sums 185 + 633 = 818, this value is updated in 'çum_Qty' column.

In workweek 4, the qty is 130 (<500), it sums 130 + 185 + 633 = 948, this value is updated in 'çum_Qty' column.

and so on.......Refer attached file for details.

 

Thank you for your help!

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: JSL to create a column that is a cumulative sum based on previous row of other columns

Here is one of the ways to code this.  It is a column formula

If( Row() == 1, x = 0 );
If( :Qty > 500,
	x = :Qty,
	x = x + :Qty
);
x;
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: JSL to create a column that is a cumulative sum based on previous row of other columns

Here is one of the ways to code this.  It is a column formula

If( Row() == 1, x = 0 );
If( :Qty > 500,
	x = :Qty,
	x = x + :Qty
);
x;
Jim
bzanos
Level III

Re: JSL to create a column that is a cumulative sum based on previous row of other columns

Thanks Jim. It works perfectly!

Recommended Articles