Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
lmenendez_grupo_pinero
Contributor III
Contributor III

fill empty values wtih the last one not empty

Hi,

I have a piece of script with Rowno() as identifier of rows.

The I supress some of the Rowno() , obtaining something like this:

rowno()_field field1
1 ñswhfñ
2 cjnklsaj
  jclal
  kjhflw
  fjlakj
6 jlñkjsae
7 fjlñejflk
8 fjkjedfrlk
9 asjfje
  jflñkj
  uiwq
12 elkwe

 

I would like to get some piece of scipt or tips to transform the previous table in this other:

rowno()_field field1
1 ñswhfñ
2 cjnklsaj
2 jclal
2 kjhflw
2 fjlakj
6 jlñkjsae
7 fjlñejflk
8 fjkjedfrlk
9 asjfje
9 jflñkj
9 uiwq
12 elkwe

 

The idea is to fill each empty row repeating the last non-empty one.

THANK YOU FOR your help.

 

Labels (1)
2 Solutions

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In script:

If(len(rowno()_field) = 0, peek('rowno()_field'), rownno()_field) as rowno()_field

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

 

View solution in original post

Digvijay_Singh

Looks like peek() can help to get the null rows filled with the previosu row value. If the values are empty instead of null then you might need to use condition like - if rowno()_field = '' 

If (isnull(rowno()_field),peek(rowno()_field),rowno()_field) as rowno()_field

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In script:

If(len(rowno()_field) = 0, peek('rowno()_field'), rownno()_field) as rowno()_field

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

 

Digvijay_Singh

Looks like peek() can help to get the null rows filled with the previosu row value. If the values are empty instead of null then you might need to use condition like - if rowno()_field = '' 

If (isnull(rowno()_field),peek(rowno()_field),rowno()_field) as rowno()_field

lmenendez_grupo_pinero
Contributor III
Contributor III
Author

Thank you very much, both are just the tip I needed. Great help for me.