Jump to content

Creating a Cross-Table Visualization with Cumulative Sums


Christopher Anderson

Recommended Posts

I realize I may have been compartmentalizing my previous questions without stating what the ultimate goal is.

I need to compile a table that shows total enrollment per company per month. I do not have the actual enrollment per month, so I have to calculate that based on enrollment date counts - termination date counts. I am able to display those individual numbers per month. I am also able to do a cumulative increase over columns (in the cross-table) that have values in them. However, if there is no activity for one month, then I see '-'.

How can I configure the table to carry over the previous month's value (if current month is zero), or add the current month's value to the previous month's value (if current month is not zero)

Attached is what I am hoping to accomplish.

Link to comment
Share on other sites

I am not quite sure how is your dataset as only the expected output is present.

You can calculatecumulative sum using over statement. like sum([sales]) over(allprevious([axis.columns])) orsum([sales]) over(previous([axis.columns])) if only interested in previous value

"-" is seen when there is no data present for that particular data point. Expression like below can be helpful using SN.

SN(sum([sales])+sum([sales]) over(previous([axis.columns])),sum([sales]) over(previous([axis.columns])))

If you search for Over functions in spotfire, you will find many examples around the same.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...