Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have Data as shown below
Header 1 | Header 2 | Header 3 |
---|---|---|
a | 1 | HI |
a | 1 | |
a | 2 | |
a | 2 | |
a | 3 | HELLO |
b | 3 | |
b | 3 |
else
PFA 1.JPG
I want to repeat Header3 value i.e" HI " for value of Header2 "1" ,and not for "2",same for HELLO for Header2 value "3"
I used Peek
Command : If(IsNull(Header3),Peek(Header3),Header3)
but it shows HI value for Header2 value "1" and "2" both
as Shown
Header 1 | Header 2 | Header 3 |
---|---|---|
a | 1 | HI |
a | 1 | HI |
a | 2 | HI |
a | 2 | HI |
a | 3 | HELLO |
b | 3 | HELLO |
b | 3 | HELLO |
Try:
LOAD
[Header 1]
, [Header 2]
, if(len(trim([Header 3]))=0 and Previous([Header 2])=[Header 2], peek([Header 3]),[Header 3]) as [Header 3]
// , RowNo() as rowid
INLINE [
Header 1, Header 2, Header 3
a, 1, HI
a, 1,
a, 2,
a, 2,
a, 3, HELLO
b, 3,
b, 3
];
See attached example
Try
If(IsNull(Header3) and Header2 = peek(Header2),Peek(Header3),Header3)
Nope, not getting
Try:
LOAD
[Header 1]
, [Header 2]
, if(len(trim([Header 3]))=0 and Previous([Header 2])=[Header 2], peek([Header 3]),[Header 3]) as [Header 3]
// , RowNo() as rowid
INLINE [
Header 1, Header 2, Header 3
a, 1, HI
a, 1,
a, 2,
a, 2,
a, 3, HELLO
b, 3,
b, 3
];
See attached example
Hi Gysbert
I got proper output using RowNo() as RowId.
Can you tell me reason for existence of RowNo() as RowId?
Because when i reload it withour using RowNo i dont get proper required output.
See the attached file excel and qlikview
hope it helps you
Hey i am sorry if i am was not specific.
I meant to say for that particular solution(which gysbert gave) i need to know it
According to me without Rowno() also we should get proper ouput but its not
Hey mohit,
I understood
Thanks