Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a table like this
Date | Item | Sale price |
---|---|---|
2/11 | item 1 | 20 |
2/11 | item 2 | 15 |
3/11 | item 1 | 25 |
4/11 | item 3 | 30 |
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
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
Thanks - I am trying to do it that way now.
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!!!
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