Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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