Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
claude_jakob
Contributor III
Contributor III

How to dynamically concatenate field values during load (Peek/while)

Hi

I am struggling with the following need within a Qlikview script:

I have an input table with 2 columns. Column1 has a ID (Pack ID), column 2 a text. During load I need to to dynamically create a table that:

- unique IDs

- concatenates the text (with "+" separator") if the Pack_ID is same.

- concatenated items need to be acendingly sorted.

I have the feeling I need to use Peek function, use variables and possibly a variable.

Input:

   

Pack IDContent
11Item C
11Item B
11Item A
12Item D
13Item D
13Item B
14Item F
14Item B
14Item D
14Item E
14Item A

Output needed:

   

Pack IDContent Concatenated
11Item A+Item B+Item C
12Item D
13Item B+Item D
14Item A+Item B+Item D+Item E+Item F

Any input much appreciated.

Thanks

Claude

1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

Use Concat

T1:

LOAD [Pack ID],

     Content

FROM

[\\lnn63f1\u_t1487402003\sasidp\My Documents\Qlikview\Example1.xlsx]

(ooxml, embedded labels, table is Sheet1);

T2:

Load

[Pack ID],

Concat(Content,'+') as Value

Resident T1

Group By [Pack ID]

Order By

[Pack ID],Content

;

drop table T1;

updated the syntax

View solution in original post

6 Replies
claude_jakob
Contributor III
Contributor III
Author

Example file attached

sasiparupudi1
Master III
Master III

Use Concat

T1:

LOAD [Pack ID],

     Content

FROM

[\\lnn63f1\u_t1487402003\sasidp\My Documents\Qlikview\Example1.xlsx]

(ooxml, embedded labels, table is Sheet1);

T2:

Load

[Pack ID],

Concat(Content,'+') as Value

Resident T1

Group By [Pack ID]

Order By

[Pack ID],Content

;

drop table T1;

updated the syntax

sasiparupudi1
Master III
Master III

PFA

claude_jakob
Contributor III
Contributor III
Author

Thanks for the script.

Works as needed !

passionate
Specialist
Specialist

Hi,

PFA,

Solution.

Regards,

Pankaj

sasiparupudi1
Master III
Master III

Please close this thread by marking a correct answer