Discussion board where members can get started with QlikView.
I have a table like this:
As you can see, in 1/4/2016 til 1/6/2016 there is a null value of Balance.
I want to put that null value to be a previous of date which last value of Balance is not null.
So the table should be like this:
Anyone can help me what is the best script to get a result like that?
Go to Solution.
I would use a peek(Balance) with an order by Date
If(Len(Trim(Balance)) > 0, Balance) as Balance;
LOAD * Inline [
alt(Balance, peek('Balance')) as Balance
Order by Date;
DROP Table Table;
View solution in original post
May be this:
If(Len(Trim(Balance)) = 0, Peek('Balance'), Balance) as Balance
That script only take effect in 1/4/2016, but the next row still null...
any another suggestion?
If(Len(Trim(Balance)) = 0, Peek('Balance'), Balance) as Balance;