Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vchuprina
Specialist
Specialist

Pivot table with calculation year to year

Hi,

I'm trying to create pivot table with following structure, but can't correctly calculate Evolution.

In my model I have weight and height and based on it I calculate index as Heigth/Weigth.

Evolution should be counted by comparing current year with previous (2017 vs 2016, 2016 vs 2015, 2015 vs 2014)

Can someone help with set expression.

   

Year2014201520162017
Weigth81879198
Height179181184190
Index0,450,480,490,52
Evolution 6,222,894,29
Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
1 Solution

Accepted Solutions
sunny_talwar

Try this:

=((Weight/Height)/Before(Weight/Height) - 1) * 100

Capture.PNG

View solution in original post

8 Replies
sunny_talwar

Is Weight and Height part of a single dimension or are they dimensions itself? Would you be able to share raw data behind this to help you better?

vchuprina
Specialist
Specialist
Author

Weight and Height are dimensions itself

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
sunny_talwar

Would you be able to share sample data or a sample qvw file?

vchuprina
Specialist
Specialist
Author

Hi Sunny,

Please find sample qvw in attachment

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
ahaahaaha
Partner - Master
Partner - Master

What exactly is compared when calculating the Evolution ? You can give an example of the calculation of Evolution for at least one year?

sunny_talwar

Try this:

=((Weight/Height)/Before(Weight/Height) - 1) * 100

Capture.PNG

vchuprina
Specialist
Specialist
Author

Thank you. I didn't know about before function

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
sunny_talwar

You can check out after and before here:

Missing Manual - Before() and After()