Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am new to Qlik Sense and I would like to know how to mentioned in the UI layer (not the script) to assign a previous value if a given measure is equal to zero.
In this example, We have date as a dimension and price as a measure, if list price is equal to zero for a given finalized date, we want the price to be the price of the last non-zero price.
This is what is shows right now
This is what I want it to show.
is there any way we can do this for all cases like this?
It is, but not the ideal way to do it....
Do we need another column? What if we do all the checking in the Price column itself. Not sure though?
Load * inline [
Date, Price
1/02/2014,2000
4/21/2014,23431
6/27/2015,34125
11/02/2017,0
12/31/2017,0
1/10/2017,0
1/12/2017,0
1/13/2017,0
1/16/2018,12343 ];
We don't ... that is sort of where this all started from... but Omar already had two expressions.... so that is why Column(3).
The basic idea is to self reference the expression for the value it shows on the previous row.
Yeah, right. hope nathan.parmeswar got options to move forward.
How to handle this in the script sunny?
Much more easier to do this in the script
If(Price = 0, Peek('New_Price'), Price) as New_Price
Thank you Sunny, Omar, and Digvijay. Very helpful.