Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

HOW TO CONCAT FIELDS?

Hi,

I am new to Qlik Sense and need help on below issue urgently.

I have a Table as follows:

I have field names Product Name in which there are different Products :

Product Name

S1

S2

S3

S4

S5

S6

CustidProduct Name
1S1
1S2
2S3
2S1

and i am looking for output like:-

CustidProducts bought
Products not bought
1S1,S2S3,S4,S5,S6
2S3,S1S2,S4,S5,S6

Actually in the Output of Products not bought I want all product name which are not bought by the Customer and they must be comma seperated.

1 Solution

Accepted Solutions
shraddha_g
Partner - Master III
Partner - Master III

For Products Brought

Concat(Distinct [Product Name],',')

View solution in original post

5 Replies
shraddha_g
Partner - Master III
Partner - Master III

For Products Brought

Concat(Distinct [Product Name],',')

Anonymous
Not applicable
Author

Thnx for reply.. but it want solution for products which are not bought..

Anonymous
Not applicable
Author

hi,

can you please help me for syntax..

Not applicable
Author

hi pradya,

Try this:

Table:

LOAD *,

  1 as Flag;

LOAD * INLINE [

    CustomID, Items

    1, S1

    1, S2

    2, S3

    2, S1

    3, S2

    3, S3

];

Temp:

LOAD DISTINCT Items as AllItems

Resident Table;

Left Join(Temp)

LOAD Distinct CustomID

Resident Table;

Join (Table)

LOAD CustomID,

  AllItems as Items

Resident Temp;

FinalTable:

LOAD CustomID,

  Concat(If(Flag = 1, Items), ', ') as [Items Bought],

  Concat(If(Flag <> 1, Items), ', ') as [Items Not Bought]

Resident Table

Group By CustomID;

DROP Tables Temp, Table;