Need to calculate cumulative value

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

Need to calculate cumulative value

Post by satheesh_color »

Hi All,

Kindly let me know your thoughts on how to calculate the cumulative value based on the below scenario

A B C Amt
1 1 1 10
1 1 2 10
1 1 3 10
1 1 4 10
1 1 4 10

From the above data i would like to calculate the cumulative as below

A B C Amt
1 1 1 10
1 1 2 20
1 1 3 30
1 1 4 10

kindly let me know your thoughts


Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:idea: Post your rules / requirements for this calculation in words first rather than make people puzzle it out from your example. Which right now really does need an explanation. :?

If all you are talking about is a running total, then all you need is a stage variable in a transformer. If your last value in the output example needs to be 50 rather than 10 then that's a horse of a different color.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Please describe the logic in words, rather than have us guess at reverse engineering what might be happening with the A B and C columns. What's your rule?
Choose a job you love, and you will never have to work a day in your life. - Confucius
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Just as I was typing that, I was thinking Craig you would say the same thing... :lol:
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:wink:

It is a pet peeve of mine, pushing one of my (sadly) many buttons.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply