Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone.
Just wanted to pick the brains of the gurus of QV. I want to repeat a value in a column that I get in a table using script, as many times until I find a non-null value in the same a column. So for example sake consider (AS-is)
| Header 1 | Header 2 |
|---|---|
| 42186 | AB |
| CD | |
| WE | |
| TT | |
| RR | |
| QS | |
| EF | |
| 42155 | GH |
| IJ | |
| KL | |
| SA | |
| AS | |
| QW | |
| MN |
I am trying to get, (To Be)
| Header 1 | Header 2 |
|---|---|
| 42186 | AB |
| 42186 | CD |
| 42186 | WE |
| 42186 | TT |
| 42186 | RR |
| 42186 | QS |
| 42155 | GH |
| 42155 | IJ |
| 42155 | KL |
| 42155 | SA |
| 42155 | |
| 42155 |
I have tried ALT, PEEK and PREVIOUS but only got values to repeat twice by using PREVIOUS.
Please help
LOAD if(len(trim([Report number]))=0,Peek([Report number]),[Report number]) as Peekedcolumn,
Column,
Numbers
FROM
...
You're peeking in the wrong field. Use peek(Peekedcolumn) or give the resulting field the name [Report number]
LOAD
If(Len(Trim([Header 1]))>0,[Header 1], Peek([Header 1]) as [Header 1],
[Header 2]
FROM
...
If [Header 1] contains only numbers you could also try Alt([Header 1], peek([Header 1])) as [Header 1]
You can use fill option in Transformation Wizard.
LOAD [Header 1],
[Header 2]
FROM
[Sample.xlsx]
(ooxml, embedded labels, table is Sheet1, filters(
Replace(1, top, StrCnd(null))
));
Same result that I had already had the values repeat 1 time and then stop. see here

Post your qlikview document and source file.
try this
Load *,
if( len(trim(Header1))=0, peek('Header1_1'),Header1) as Header1_1
FROm Table
I want to do it via script.
see reply above
The above code is load script.!!
what reply?