Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

gauravgg
New Contributor III

Fill previous value where there is blank

Hi All

I have the following table

CurrencyDateValue
USD01/01/201756
USD02/01/2017
AED01/01/201718
AED
02/01/2017
AED
03/01/2017
AED
04/01/2017

I want the following output

CurrencyDateValue
USD01/01/201756
USD02/01/201756
AED01/01/201718
AED
02/01/2017
18
AED
03/01/2017
18
AED
04/01/2017
18

ie where ever there is null value in the Value field ,i want to put previous value in that field

can anyone help me

Thanks in advance

Tags (1)
7 Replies
MVP
MVP

Re: Fill previous value where there is blank

Try like:

Load

          Currency,

          Date,

          If(Len(Trim(Value))=0, peek(Value), Value) as Value

From <>:

Note: Your loading sort order might have to be defined using Order By clause;.

gauravgg
New Contributor III

Re: Fill previous value where there is blank

Hi Thanks for reply

But it is not working.

is there any other way ?

MVP
MVP

Re: Fill previous value where there is blank

Could post a qvw with sample data set showing that is not working?

roharoha
Valued Contributor III

Re: Fill previous value where there is blank

Try like:

Load

          Currency,

          Date,

          If(Len(Trim(Value))=0, peek(Value), Value) as Value

From <>:

Note: Your loading sort order might have to be defined using Order By clause;

try with peek('Value') instead

MVP
MVP

Re: Fill previous value where there is blank

It works even without quotes.

roharoha
Valued Contributor III

Re: Fill previous value where there is blank

that's new for me... but ok

ahmar811
Contributor III

Re: Fill previous value where there is blank

Hi

Gaurav

Please find the attached file for your output

Capture.JPG

Regards

Ahmar