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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Roberto_Licciardello
Partner - Contributor III
Partner - Contributor III

Trend Variation

Hi guys,

I need to calculate the trend variation of an average of prices (so for example December 2024 on December 2023). I'm using a formula like this (AMListino is in YYYY/MM format and PrezzoCIM is the price of each product):

Avg( {<AMListino={"Date(AMListino, 'YYYY/MM')"}>} PrezzoCIM)

but it doesn't want to work. The dimension of the chart is AMListino.

Any ideas?

 

Thanks!!!

Labels (4)
3 Replies
Clement15
Partner - Specialist
Partner - Specialist

Hello,

 

do you want to make the average between two specified dates?
If that's it, you can use a measure of this structure:

 

Avg({<AMListino={">=$(='2023/12') <=$(='2024/12')"}> PrezzoCIM)

 

Another example, if you want to take the last years according to the max date you can use this:
sum({<AMListino={">=$(=max(DATETEST)) <=$(=date(addmonths(max(DATETEST),-12),'YYYY/MM'))"}>}IDTEST)

Roberto_Licciardello
Partner - Contributor III
Partner - Contributor III
Author

Thanks, but unfortunately it doesn't solve my problem. I need the monthly values ​​by month. In practice:

- variation January 2024/January 2023
- variation February 2024/February 2023
- variation March 2024/March 2023
- variation April 2024/April 2023

and so on. In practice what you can see in the graph I attach (made in Excel)

 

Roberto_Licciardello_0-1734363749190.png

 

where the percentage changes are compared to the same month of the previous year.

 

Clement15
Partner - Specialist
Partner - Specialist

Hello,
Then using modifiers might help you.

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Measures/modifiers.htm
(part Moving average)

 

Clement15_0-1734367161318.png


So the output should look like this :

 

RangeAvg(Above( ( Sum(PrezzoCIM) ) , 0, 12))