Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Combine two lines into one label from load (e.g. excel)

Hi,

Is it posssible to use two lines (e.g. from excel) and combine them into one line, which is used as (embedded) label of the field?

E.g.:

Header 1 part aHeader 2 part aHeader 3 part aHeader 4 part aHeader 5 part a
Header 1 part bHeader 2 part bHeader 3 part bHeader 4 part bHeader 5 part b
DataDataDataDataData
DataDataDataDataData
DataDataDataDataData
DataDataDataDataData

So the two header parts should be combined into one label.

1 Solution

Accepted Solutions
rbecher
MVP
MVP

Hi Koen,

I hope I understand it right.. It's a bit complicated but can be done by Rename Fields Using <Map>:

Header:

Crosstable LOAD 0 as Dummy,

     Concat(A, ' ', RecNo()) as A,

     Concat(B, ' ', RecNo()) as B,

     Concat(C, ' ', RecNo()) as C,

     Concat(D, ' ', RecNo()) as D,

     Concat(E, ' ', RecNo()) as E

FROM

D:\header.xlsx

(ooxml, no labels, table is Tabelle1)

Where RecNo()<3;

FieldMap:

Mapping Load Type, Value Resident Header;

Drop Table Header;

Data:

LOAD A,

     B,

     C,

     D,

     E

FROM

D:\header.xlsx

(ooxml, no labels, header is 2 lines, table is Tabelle1);

Rename Fields Using FieldMap;

- Ralf

Astrato.io Head of R&D

View solution in original post

2 Replies
rbecher
MVP
MVP

Hi Koen,

I hope I understand it right.. It's a bit complicated but can be done by Rename Fields Using <Map>:

Header:

Crosstable LOAD 0 as Dummy,

     Concat(A, ' ', RecNo()) as A,

     Concat(B, ' ', RecNo()) as B,

     Concat(C, ' ', RecNo()) as C,

     Concat(D, ' ', RecNo()) as D,

     Concat(E, ' ', RecNo()) as E

FROM

D:\header.xlsx

(ooxml, no labels, table is Tabelle1)

Where RecNo()<3;

FieldMap:

Mapping Load Type, Value Resident Header;

Drop Table Header;

Data:

LOAD A,

     B,

     C,

     D,

     E

FROM

D:\header.xlsx

(ooxml, no labels, header is 2 lines, table is Tabelle1);

Rename Fields Using FieldMap;

- Ralf

Astrato.io Head of R&D
Not applicable
Author

Thanks! Works solid.