Desktop productivity for business analysts and programmers

How do you create cumulative values in Expression Builder in Ent Guide?

Reply
Not applicable
Posts: 0

How do you create cumulative values in Expression Builder in Ent Guide?

I am struggling with trying to create a computed column that calculates the cumulative values of another column. This does not seem like it would be a difficult task, however, there does not appear to be a function that does this. Does anyone know of a function, or some trick in order to generate cumulative values within enterprise guide?
Trusted Advisor
Posts: 2,127

Re: How do you create cumulative values in Expression Builder in Ent Guide?

Posted in reply to deleted_user
Actually, this is one of the things that are hard to do in PROC SQL and I'm not even sure that it can be done. You are asking to do a running total and that requires an assigned order to the data. SQL is designed to be done without any order while it is working.

This is easy to do in a data step, but that requires a code task.

Doc Muhlbaier
Duke
Not applicable
Posts: 0

Re: How do you create cumulative values in Expression Builder in Ent Guide?

I was able to figure this out for anyone who is interested in knowing.

data work.NewTableName;
set work.TableYourFieldisIn;
'NewCumulativeColumnName'n + 'FieldForCumulativeColumnToSum'n;
run;

This will put out a new table containing the information from your reference table as well as your new cumulative column.
Not applicable
Posts: 0

Re: How do you create cumulative values in Expression Builder in Ent Guide?

Posted in reply to deleted_user
Oh yeah, i forgot to mention that the above entry can be done in a "Code Step" in EG
Ask a Question
Discussion stats
  • 3 replies
  • 234 views
  • 0 likes
  • 2 in conversation