Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Repeat last value for each null value

Hi Community,

I have the below data set where i only have Value column. What i would like to create is DesiredValue_Column. In other words, i would like to scan the contents of Value column and repeat the same number if Value column is not null. If value column is null then repeat the previous number from Value column until value column is not null.

For example after value =3, it is null there i repeat 3 until value = 6 and then i simply copy the content of 6. Hope this makes sense. Any guidance is appreciated. Thanks.

  

ValueDesiredValue_Column
11
22
33
3
3
66
77
7
7
1010
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Load

          If(len(trim(Value))=0, Peek(NewValue), Value) as NewValue

View solution in original post

2 Replies
Anil_Babu_Samineni

You can create one variable with the function of peek then the value should be repeated

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresesco
MVP
MVP

Try like:

Load

          If(len(trim(Value))=0, Peek(NewValue), Value) as NewValue