Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Calculate Trend Line

Hi, I have been trying for weeks to figure this out but still have not succeeded.  I created a chart to show supply and demand side-by-side with weeks as my dimension.  I want to add a trend line to the graph that displays ending inventory from the week before.

The calculation for this week's ending inventory is [Last Week's Ending Inventory] + [Supply] - [Demand].  It seems simple but I can't figure it out.  How would I write the calculation for ending inventory by week? 

Here is a picture of what I am trying to accomplish:

inventory.JPG

1 Solution

Accepted Solutions
pover
Honored Contributor

Calculate Trend Line

One option is you use above([End Inventory]) to call the previous ending inventory, but you have to view all weeks for it to work. 

Another option is the AsOf table.  You can find examples in the community allows you to accumulate values over time when you are using time as your dimension.

Karl

3 Replies
pover
Honored Contributor

Calculate Trend Line

One option is you use above([End Inventory]) to call the previous ending inventory, but you have to view all weeks for it to work. 

Another option is the AsOf table.  You can find examples in the community allows you to accumulate values over time when you are using time as your dimension.

Karl

Not applicable

Re: Calculate Trend Line

Will the above function still work since I am calling ending inventory from the previous week, even though ending inventory from that week is calculated from the one before that?

pover
Honored Contributor

Re: Calculate Trend Line

Yes, you can refer to a column in the above row that refers to the row above it.  I attached a simple example.

Karl

Community Browser