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: 
Not applicable

operations with Last and previous values

Hi Community,

      could you please help me to figure out this?

I have a kind of this table -->

Type
Product
change_date
price
xxA2017/0211
xxA2016/119
yyyB2017/045
yyyB2017/0110
yyyB2016/096

And what i need is this -->

Product
change %Price (regarding last and previous price)
A(11/9)-1 = 22%
B(5/10)-1 = -50%

Thanks for any help!

Gerardo

1 Solution

Accepted Solutions
sunny_talwar

Here added some extra data to show it would work in the attached qvw

Capture.PNG

View solution in original post

5 Replies
sunny_talwar

May be this

Dimension

Product

Expression

FirstSortedValue(price, -change_date)/FirstSortedValue(price, -change_date, 2) - 1

Not applicable
Author

Works! but, what if the change is 0%. Can i do something to keep the "0%"?

Thanks!

gerardo

sunny_talwar

Uncheck 'Suppress Zero Values' on the presentation tab

sunny_talwar

Here added some extra data to show it would work in the attached qvw

Capture.PNG

Not applicable
Author

thanks a lot!