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 Historical average

This is a bit of a newbie question I think.

I am trying to figure out how to calculate the change in the historical average for a value, and display in a chart or table.

Here is an example.

   

Trade DateCusipCurrent TES
3/2/201500037CRG7154.6654
3/2/201500037CRG7156.0904
3/2/201500037CRG7170.3641
3/3/201500037CRG7150.2771
3/11/201500037CRG7161.8665

The historical average is the average(Current TES) of all records other than the ones on the most recent date. The change in the historical average is the difference between the average of all records prior to most recent date and the average of the records on the most recent date.

Thanks!

1 Reply
MarcoWedel

Hi,

one solution could be:

=Avg([Current TES])-RangeSum(Above(Sum([Current TES]),1,RowNo()-1))/RangeSum(Above(Count([Current TES]),1,RowNo()-1))


QlikCommunity_Thread_162411_Pic2.JPG


QlikCommunity_Thread_162411_Pic3.JPG



QlikCommunity_Thread_162411_Pic1.JPG


hope this helps


regards


Marco