Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ceccannito
Contributor II
Contributor II

percentage change previous years

Hi,

I want to calculate the percentage of change of years compared to the previous, in a table with year, measure number and measure number of previous year.

I have a field measure and year field.

Can you hel me?

Thanks a lot.

1 Solution

Accepted Solutions
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi 

Please go through the attached file you will get the some idea 

Hope this helps

Thanks

Thanks and Regards
Kashyap.R

View solution in original post

6 Replies
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi 

PFA

 

Thanks

Thanks and Regards
Kashyap.R
ceccannito
Contributor II
Contributor II
Author

Thanks Kashyap, but as i take only 10 years, I would like the first row to be populated with 2008 data:

  • SUM(QUANTITY)

SUM({$<[VAR TIPO DATA]= {"ATTIVAZIONE"}, [VAR ANNO FORNITURA] = {">=$(=YEAR(TODAY())-10)"}>}[VAR NUM FORNITURE])

  • ABOVE(SUM(QUANTITY))

ABOVE(SUM({$<[VAR TIPO DATA]= {"ATTIVAZIONE"}, [VAR ANNO FORNITURA] = {">=$(=YEAR(TODAY())-10)"}>}[VAR NUM FORNITURE]))

I attached an image, where you can see that the first row for 2008,  didn't populate.

How i can do?

Thanks a lot.

 

 

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Above function only works on the data that is present int the table you are restricting years from 2009-2019

so it is taking 2008 as Null value, if you want 2008 value you have to do it in the script using peek/previous function

Hope this gives some idea

Thanks

Thanks and Regards
Kashyap.R
ceccannito
Contributor II
Contributor II
Author

I tried, but seem doesn't work:

Load
[VAR TIPO DATA],
[VAR ANNO FORNITURA],
[VAR NUM FORNITURE],
Peek('VAR NUM FORNITURE') AS [VAR NUM FORNITURE PREC]
RESIDENT [VARIAZIONE FORNITURA TMP]
Where [VAR ANNO FORNITURA]>= YEAR(Today())-10.

I obtain incorect values of VAR NUM FORNITURE PREC.

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi 

Please go through the attached file you will get the some idea 

Hope this helps

Thanks

Thanks and Regards
Kashyap.R
ceccannito
Contributor II
Contributor II
Author

Thanks you so much, now works!! 🙂