Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Is there a way when using the peek function to check whether the field before it is text or a number? I have an excel file where the data has been placed in such a way that the first column has the person's name in it and then underneath it is the data relating to that person. I would like to be able to assign that person's name to the data without cutting and pasting to change the excel files layout before loading. Is that possible?
Thanks
e.g.
Client |
Jensen Button |
54678 |
23564 |
78654 |
Adam Eve |
23456 |
56745 |
98756 |
LOAD Txt As Data,If(Num(Txt) > 0,Peek(Txt),Txt) As Txt Inline [
Txt
Jensen Button
54678
23564
78654
Adam Eve
23456
56745
98756];
Hi,
one solution might be:
table1:
LOAD If(IsText(Client),Client,Peek(Client)) as Client,
Client as Data
FROM [http://community.qlik.com/thread/136009] (html, codepage is 1252, embedded labels, table is @1);
Right Join
LOAD Distinct Data
Resident table1
Where IsNum(Data);
hope this helps
regards
Marco
or even shorter:
LOAD If(IsText(Previous(Client)),Previous(Client),Peek(Client)) as Client,
Client as Data
FROM [http://community.qlik.com/thread/136009] (html, codepage is 1252, embedded labels, table is @1)
Where IsNum(Client);
hope this helps
regards
Marco