Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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
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
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
Thank you very much, both are just the tip I needed. Great help for me.