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

Concat string

Dear all,

I have a one table like

Product
1
2
3
4
5
6
7
8
9
10

and other table like

ProductEvent
2Gift
2Xmas
3Gift
5Gift
7Gift
7Xmas
10Gift
10Xmas
10New Year

Now I want in Staight table like below..

ProductEvent
1None
2Gift, Xmas
3Gift
4None
5Gift
6None
7Gift, Xmas
8None
9None
10

Gift, Xmas, New Year

Acually I want to concate all event against the Product in Straight Table.

Please help me.

Regards

Vinay

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

I would try putting the if() within the aggregation function so that it calculates at the detailed level and then puts together a delimitted list of the distinct values.


Concat(Distinct if(IsNull(Event),'None',Event) ,',')

View solution in original post

7 Replies
Not applicable
Author

Hi Vinay,

Concat(Distinct Event,',')

give that a try in your expression with Product as your dimension

hope that helps

Joe

simondachstr
Luminary Alumni
Luminary Alumni

Load first table and left join the second table.

Then do a resident load with a group by

LOAD

Product,

if(isNull(Event),'None',Concat(Event,','))

Resident Table

Group by Product;

Edit:

Thought you wanted to achieve that in the script - for a straight table solution go with the above suggestion.

Not applicable
Author

Hi,

i am using below in straight table expression

if(IsNull(Event),'None',Concat(Distinct Event,','))

but not give me coorect result.

Not applicable
Author

Hi,

Just load the two tables with Field name 'Product' remaining same.

Attaching the document for your help.

Untitled.png

Not applicable
Author

An example app would be good if possible

rubenmarin

Hi, please check attachment, I provided a script solution and a expression solution.

Hope this helps.

JonnyPoole
Employee
Employee

I would try putting the if() within the aggregation function so that it calculates at the detailed level and then puts together a delimitted list of the distinct values.


Concat(Distinct if(IsNull(Event),'None',Event) ,',')