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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
shruthibk
Creator
Creator

nested concat on pivot table

Hi All,

I have a requirement to concat two fields to show in a pivot table.

Week, Category, title

1,beauty,Test1

1,beauty,Test2

1,Espresso,Test2

 

expected output

week  1

 test1,test2(beauty),Test2(espresso)

Kindly help me with the concat function 

 

Thanks,

Shruthi B K

 

 

 

1 Solution

Accepted Solutions
sunny_talwar

You can try this

=Concat(DISTINCT Aggr(Concat(DISTINCT title, ',') & '(' & Category & ')', Week, Category), ',')

View solution in original post

9 Replies
jaibau1993
Partner - Creator III
Partner - Creator III

Hi!

Use something like the following as expression:

Concat(Distinct title & '(' & Category & ')')

Regards,

Jaime. 

shruthibk
Creator
Creator
Author

the expression doesn't return the desired output

shruthibk
Creator
Creator
Author

the suggested expression is giving the output

 test1(beauty),test2(beauty),Test2(espresso)

 

but expected output is 

test1,test2(beauty),Test2(espresso)

 

Anil_Babu_Samineni

What is the O/P you need from below table?

Week, Category, title

1,beauty,Test1

1,Espresso,Test2

1,beauty,Test1

1,Espresso1,Test2

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
shruthibk
Creator
Creator
Author

for week 1

Test1(beauty),Test2(Espresso,Espresso1)

sunny_talwar

You can try this

=Concat(DISTINCT Aggr(Concat(DISTINCT title, ',') & '(' & Category & ')', Week, Category), ',')
shruthibk
Creator
Creator
Author

Thank you Sunny 🙂

sunny_talwar

But this doesn't seem to work with the solution you provided to @Anil_Babu_Samineni updated sample.

bixpahalley
Contributor II
Contributor II

you can try this, it's work.

=Concat(DISTINCT Aggr(Concat(DISTINCT title, ',') & '(' & Concat(DISTINCT Category,',') & ')', Week, Category), ',')