turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Accumulate column data

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Mar 17, 2009 12:14 PM
(1286 views)

How do I use the lag operator to add up data on a row wise basis? That is, I want to accumulate data from column tair in a new column called chilling degree if the tair value is > 5.

tair chilling degree

5 5

7 5

5 10

tair chilling degree

5 5

7 5

5 10

2 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Mar 17, 2009 1:12 PM
(1025 views)

I don't know the answer to this question, but it sounds like you're working with building energy data. Am I right? That's my field as well so I'd be happy to trade scripts and files with you.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Mar 18, 2009 11:00 AM
(1025 views)

If you want to simply accumulate values in a column, you don't necessarily need the lag operator. If you want to accumulate data (get a cumulative sum) for a column called "tair", do the following:

1. Create a new column. In this example, I call it "total".

2. Put the following formula in the new column:

(ignore this line)

The formula takes the value of tair in the current row, and adds it to the previous value of total, thus creating a cumulative sum.

If you only want to accumulate the values if they are greater than or equal to 5, then use the formula:

(ignore this line)

The formula looks at the current value of tair, and if it is less than 5, instead of adding tair, it adds 0.

1. Create a new column. In this example, I call it "total".

2. Put the following formula in the new column:

(ignore this line)

The formula takes the value of tair in the current row, and adds it to the previous value of total, thus creating a cumulative sum.

If you only want to accumulate the values if they are greater than or equal to 5, then use the formula:

(ignore this line)

The formula looks at the current value of tair, and if it is less than 5, instead of adding tair, it adds 0.