Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

cumulative sum style question

Hi Guys,

Can anyone help me have a column with cumulative sales info from the beginning of time in my data i.e. Jan 2008?

Thanks

C

1 Solution

Accepted Solutions
Not applicable
Author

swuehl, thanks for the help.  I used a mixture of your suggestion and a bit of research into other things and came up with what I needed.  It looks something like this -

=sum({<[Transaction Date] = {"<=$(=max([Transaction Date]))"}, Year, Month>}Sales)

Seems to work so far.

Thanks again

C

View solution in original post

6 Replies
swuehl
MVP
MVP

Try an expression like

=rangesum(above(sum(Sales),0,RowNo()))

Not applicable
Author

Thanks swuehl, that is exactly where I am currently.  However I need to go one step further. 

What do I add to the expression so that I can select 2009 and April from the dimension and it then I still get a cumulative from Jan-2008 through to April 2009?

swuehl
MVP
MVP

Maybe

=rangesum(above(sum({<[Transaction Date] = {"<=$(=max([Transaction Date]))"}, Year, Month>}Sales),0,RowNo()))

Not applicable
Author

That works! thanks.

Now my issue is if I replace the date dimensions with the Products it doesn't work.  I want a tbale that gives me sales to date (right from the beginning of time) for each product.  I initially simplified it think that the next bit would work fine.

swuehl
MVP
MVP

Then your SalesToDate expression might be a good start. What about changing it to

=sum( {$<[Transaction Date]={"<=$(vEnd)"},Year,Month >}  Sales)

Not applicable
Author

swuehl, thanks for the help.  I used a mixture of your suggestion and a bit of research into other things and came up with what I needed.  It looks something like this -

=sum({<[Transaction Date] = {"<=$(=max([Transaction Date]))"}, Year, Month>}Sales)

Seems to work so far.

Thanks again

C