cancel
Showing results for 
Search instead for 
Did you mean: 

Cumulative Sum creation Error?

chandrasekhar6
Participant
0 Kudos

Hi All,

Can I created Cumulative sum of salary based on Department Number but last row calculated only previous row only.

Custom function and Error attached as below.

Thanks,

Chandra

Accepted Solutions (1)

Accepted Solutions (1)

former_member187605
Active Contributor
0 Kudos

Almost correct

This will work when you define $PREV_DEPT and $PREV_SAL as global variables instead of parameters (that are local to the call).

Make sure you initialise them properly before your first function call.

chandrasekhar6
Participant
0 Kudos

Hi Drik Venken,

Thanks for your response.

When I remove $PREV_DEPT and $PREV_SAL local variables and assign global variables it shows

as below.

Thanks,

Chandra

former_member187605
Active Contributor
0 Kudos

That simply means you haven't redefined them as a global variable yet.

Or you're testing your function outside of the context (project & job) where they are defined.

chandrasekhar6
Participant
0 Kudos

Thanks Drik for your valuable suggestions

Answers (0)