Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

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

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

2 Replies
MVP
MVP

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

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

Not applicable

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

Thanks! Works solid.

Community Browser