Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with Running Average

Hi Everyone,

I am new to QlikView and have an issue I would like help with. I have a simple production report setup as a straight table. The dimension is the Date, the first expression is the sum of volume produced that day and the second is the same expression but with full accumulation checked so that total volume will be accumulated. The third expression needs to be a running average of the total volume / # of days so far. so for example, it should look something like this:

DateDaily ProductionMTDAvg
1-Jan555
2-Jan6115.5
3-Jan10217


as you can see, for 1-Jan the AVG is 5 divided by 1. For 2-Jan it's 11 divided by 2 and for 3-Jan it's 21 divided by 3.

I am using the day() function to get the number of days to divide by, but I cannot figure out how to capture the total MTD volume on each row to create this average. Any suggestions?

Thanks!

Elizabeth

4 Replies
Not applicable
Author

Hi,

Please use Peek and Previous function in the script.

Regards

Amit

Not applicable
Author

Is there anything that can be used within the chart expression?

Not applicable
Author

Hi EPayne,

any relation to TPayne?? har har...

I would do this to get MTD Volume:


sum (total <FiscYear, Month> Volume)


Your formula may look a bit different depending on your table names for fiscal year, month, and volume. Let me know if you need more clarification.

johnw
Champion III
Champion III

Attached is one approach.