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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
pavendhan
Partner - Contributor III
Partner - Contributor III

Create script table

Hi,

I have data like

No:111

Name:aaaa

No:222

Name:bbb

No:333

Name:ccc

No:444

Name:ddd

The result, I need

NoName
111aaaa
222bbb
333ccc
444ddd

Hope someone help me

Thanks

1 Solution

Accepted Solutions
maxgro
MVP
MVP

like this?

1.png


tmp:

load rowno() as Id, subfield(row, ':', 2) as Field  inline [

row

No:111

Name:aaaa

No:222

Name:bbb

No:333

Name:ccc

No:444

Name:ddd

];

final:

load Id, Field as No Resident tmp where Odd(Id);

join (final) load Id -1 as Id, Field as Name Resident tmp where not Odd(Id); 

drop table tmp;

View solution in original post

11 Replies
sunny_talwar

Script:

Table:

LOAD * Inline [

No., Name

111, aaaa

222, bbb

333, ccc

444, ddd

];

Output:

Capture.PNG

pavendhan
Partner - Contributor III
Partner - Contributor III
Author

I need to loop through the data automaticaly

sunny_talwar

Not sure I understand what you mean. Can you elaborate your requirement?

pavendhan
Partner - Contributor III
Partner - Contributor III
Author

if we have thousand of rows,

for example:

Loop through from first line to end

Loop start

take No(111)

take Name

Loop end(aaaa)

after 222 etc..

sunny_talwar

Why do you need to loop, why can't you do a simple load? Is data structured in a way that a regular load won't work? You need to provide some details in order to get what you are looking for.

Best,

Sunny

pavendhan
Partner - Contributor III
Partner - Contributor III
Author

I have external notepad file having data like

No:111

Name:aaaa

No:222

Name:bbb

No:333

Name:ccc

No:444

Name:ddd

etc.....

I have to load all data into table.

The table with columns like

No,Name

111,aaaa

222,bbb

.

.

etc....

if we give the notepad file path, The data should loaded automatically and generate the table as I expected.

Thanks

maxgro
MVP
MVP

like this?

1.png


tmp:

load rowno() as Id, subfield(row, ':', 2) as Field  inline [

row

No:111

Name:aaaa

No:222

Name:bbb

No:333

Name:ccc

No:444

Name:ddd

];

final:

load Id, Field as No Resident tmp where Odd(Id);

join (final) load Id -1 as Id, Field as Name Resident tmp where not Odd(Id); 

drop table tmp;

pavendhan
Partner - Contributor III
Partner - Contributor III
Author

Now its working .

Thanks to all

Pav

sunny_talwar

If you got what you wanted, please mark Massimo's‌‌ answer as correct answer to close this thread.

Best,

Sunny