Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Fill value with previous value

I want to fill empty cell with the previous value where is not null, this is possible?

i do this

if( (IsNull(Value) or Value= 0) and ID= Previous(ID), Previous(Value), Value)

but only fill the previous value.

Example:tabla.PNG

9 Replies
Chanty4u
MVP
MVP

try this

     If(Value, Value, Peek(Value1)) as Value1

shiveshsingh
Master
Master

try this

load ID,if(ID=Previous(ID) and Len(Value)=0,Peek(Value), Value) as Value;

LOAD * INLINE [

    ID, Value

    A, 1.3

    A

    A

    B, 4.5

    B

    B, 3.4

    B

    C, 1.1

    C

    C

    C

];

Capture.JPG

sunny_talwar

Try this

if((IsNull(Value) or Value= 0) and ID= Previous(ID), Peek('New_Value'), Value) as New_Value

Anonymous
Not applicable
Author

Hi shiveshsingh , it does not work, just fill one of the empty records. The others remain empty.

I appreciate your support.

Anonymous
Not applicable
Author

Hi stalwar1, it does not work, just fill one of the empty records. The others remain empty.

I appreciate your support.

Anonymous
Not applicable
Author

I share the result

x.PNG

sunny_talwar

table box always show the unique combination of your dimension... For example if ID = A and Value = 1.3 repeats 10 times, it will still be shown only once in your table box object.

This image proves that what you wanted actually worked, because it it didn't then you would have seen two rows for A... one with 1.3 and the other with null

vishsaggi
Champion III
Champion III

can you share that qvw file where you see those empty records and also share your script what you were running.

Anonymous
Not applicable
Author

Thaks, it works