Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

alfasierra
Contributor II

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
Partner
Partner

Re: Add first row of a table at all other row

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
Partner
Partner

Re: Add first row of a table at all other row

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