Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
user467341
Creator II
Creator II

Concat data in the same column if rows are the same?

Hi everyone, I want to concat my data in the same column if the rows are the same. Let me show an example:

user467341_0-1681699204844.png

Tis is my table.

The output I want is:

user467341_1-1681699246258.png

You can see that the LEFT column data are concat with a ','. They are group based on the ID, category and ref.

Can this be done in the EXPRESSION? I do not want to modify anything at my LOAD script.

Thank you.

 

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Add a calculated dimension as below

 

= Aggr( Concat(Distinct Left,',') , ID,Category,Ref )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

8 Replies
MayilVahanan

Hi

Same thing, you can achieve in Front end by Concat function

Dim: ID, Category, Ref

Exp: Concat(Distinct Left, ',')

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
QlikSenseEnthusiast
Contributor
Contributor

Hi ...

Try this below code...It will work definitely

FACT:

Load 

ID,

Category,

Reference,

Concat(Distinct Left, ',') as Combined_Data

FROM [lib........](qvd)

Group BY 

ID,

Category,

Reference;

Mark this as Solution if it helps...

 

 

 

 

user467341
Creator II
Creator II
Author

Hi Mayil,

Thanks for your reply. I tried but am receiving error.

My current expression is this - IF(ISNULL(category),Left).

I tried to put the CONCAT infront but got error.

MayilVahanan

Hi

Try like below

Concat(Distinct IF(ISNULL(category),Left), ',')

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
user467341
Creator II
Creator II
Author

Hi Mayil,

I tried that but got

user467341_0-1681710623670.png

Expression did not show any issue though...

user467341_1-1681710646689.png

 

 

MayilVahanan

Hi

It should be expression not dimension 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
user467341
Creator II
Creator II
Author

Hi Mayil,

Sorry what do you mean? I am putting this at the table chart dimension side (I do not want to edit the load script).

Where can I find the place to put your line in expression?

vinieme12
Champion III
Champion III

Add a calculated dimension as below

 

= Aggr( Concat(Distinct Left,',') , ID,Category,Ref )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.