Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Add first row of a table at all other row

Hi ,

i have text file like this

16/02/2018

item1  100

item 2 200 etc

i wold like have restult :

16/02/2018  item1  100

16/02/2018  item2  200

how can i do?

Thank

1 Solution

Accepted Solutions
prasad_dumbre
Partner - Creator
Partner - Creator

Hi Andrea,

You can use below script to achieve to the desired result:

Data:

LOAD @1 as OG_Data

FROM

thread_291673.txt

(txt, codepage is 1252, no labels, delimiter is '\t', msq);

Final:

LOAD

left(OG_Data,7) as Item,

KeepChar(mid(OG_Data,7),'0123456789') as Value

,Peek(OG_Data,0,'Data') as Date

Resident Data

where wildmatch(OG_Data,'*Item*');

DROP Table Data;

Output Screenshot:

Thread_291673_Output.PNG

View solution in original post

1 Reply
prasad_dumbre
Partner - Creator
Partner - Creator

Hi Andrea,

You can use below script to achieve to the desired result:

Data:

LOAD @1 as OG_Data

FROM

thread_291673.txt

(txt, codepage is 1252, no labels, delimiter is '\t', msq);

Final:

LOAD

left(OG_Data,7) as Item,

KeepChar(mid(OG_Data,7),'0123456789') as Value

,Peek(OG_Data,0,'Data') as Date

Resident Data

where wildmatch(OG_Data,'*Item*');

DROP Table Data;

Output Screenshot:

Thread_291673_Output.PNG