Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Ax
Contributor II
Contributor II

Select previous month's value in pivot table if the value for that month is not set

Hi,

I have a pivot table, where [Year Month] is column and measure is 'Price'.

I would like to create an expression that uses the price for that month or the previous available price, if the price has not been set.

It should be something like this:

IF(Price > 0, Price, Select previous available price)

Thank you!

Labels (1)
2 Replies
Ax
Contributor II
Contributor II
Author

I sort of found a solution. I can use Before(Price) to get the value in previous cell. However, this only works for the first missing value, and after that as there is no price in previous cell it does not get the number.

How can I use Before to get the number from previous cell? Or use it recursively?

durgesh22
Creator
Creator

This cab be done with Column reference, you may have to change you expression if new columns are added .
But for now it should work.

if(sum(Price)=0,Above(Column(1)),Sum(Price))