Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
could you please help me to figure out this?
I have a kind of this table -->
Type | Product | change_date | price |
---|---|---|---|
xx | A | 2017/02 | 11 |
xx | A | 2016/11 | 9 |
yyy | B | 2017/04 | 5 |
yyy | B | 2017/01 | 10 |
yyy | B | 2016/09 | 6 |
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
Here added some extra data to show it would work in the attached qvw
May be this
Dimension
Product
Expression
FirstSortedValue(price, -change_date)/FirstSortedValue(price, -change_date, 2) - 1
Works! but, what if the change is 0%. Can i do something to keep the "0%"?
Thanks!
gerardo
Uncheck 'Suppress Zero Values' on the presentation tab
Here added some extra data to show it would work in the attached qvw
thanks a lot!