Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
shans_bala
Contributor
Contributor

Finding the average of difference between Current and last month stock for 12 months

Hi,

I have a scenario where the average of difference between Current and last month stock for 12 months needs to be shown.

Example:

shans_bala_0-1634652845638.png

 

Please share you ideas.

 

1 Reply
MarcoWedel

this should be equal to
(LastMonthStock-FirstMonthStock)/(# of months -1)

so maybe
=(FirstSortedValue(Stock,-[Year Month])-FirstSortedValue(Stock,[Year Month]))/(Count(DISTINCT [Year Month])-1)

might work

hope this helps
Marco