How to get Running Totals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2018 02:00 PM
Hello.
I want to get running totals: here is my raw dataset:
key1 key2 qtr ct
-
2. 1. 5
-
3. 2. 4
-
4. 3. 1
-
5. 4. 3
My result:
key1 key2 qtr RunningTotal
-
2. 1. 5
-
3. 2. 9
-
4. 3. 10
-
5. 4. 13
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018 10:07 AM
I have not tried it, but is it possible to set a pipeline parameter to zero and then using a mapper to increment the value?
Pipeline parameters are discussed here: https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438254/Pipeline+Properties
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018 10:38 AM
Not sure if there is a Snap that does this type of thing directly, you might need to use the Script snap.
Alternatively, you can use the GroupByN snap to collect all of the documents into a single big document, use the expression language to operate on that, and then split the docs out again.
Pipeline parameters cannot be changed during the execution of a pipeline.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018 10:40 AM
I don’t think that will work since you can’t update a pipeline parameter. This is a tough one, you might end up doing this either on the source or target system.
