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

cumulative data in chart

Hello,

I have a table like this

DateItemSale price
2/11item 120
2/11item 215
3/11item 125
4/11item 330

I need to build a line chart with cumulative sales over time on it.

I have a dimension of Date but how do I calculate a sum of sales up until that date in an expression?

Thanks!!

D

4 Replies
jeffmartins
Partner - Creator II
Partner - Creator II

Hi yallow83,

This post explains how to create an expression with accumulative sum.

http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/12/accumulative-sums

Regards

Not applicable
Author

Thanks - I am trying to do it that way now.

Not applicable
Author

Hi,

I used the "full accumulation" option and it worked perfectly.

Now I want to use the resulting accumulated field (Sales To Date at cost) and add it to (Remaining Inventory at cost) to get Total Inventory at cost.

The second field should not be accumulative (Total Inventory at cost), but the first should (Sales To Date at cost).

I tried to just use the first field name (Sales To Date) in a formula for the second field (Total Inventory) without setting "full accumulation" checkbox, but it looks like it recalculates the field without accumulation.

Can I force it to use the already calculated field value (where accumulation is on)?

Many thanks!!!

jeffmartins
Partner - Creator II
Partner - Creator II

Hi yallow83,

You should create a formula for the "Sales To Date at cost" field without the full accumulation option checked.

Then add the "Sales To Date at cost" and "Remaining Inventory at cost" expressions to get the " Total Inventory at cost" expression.

See the attached file.

Regards