Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
brindlogcool
Creator III
Creator III

Field Concatenation

I want to concatenate district and product columns like this District (P1,P2,P3). District,P1,P2,P3 are individual columns.

The problem here is always not all the P1,P2,P3 will not have values . So there can be scenarios as below

District --- No product so it should display  District

District ,P1 is NULL, P2,P3 --- District (P2,P3)

I tried to concatenate it is coming with blanks as District (,P2,P3)

I tried to loop through and create tables but it is creating multiple tables and not working

 

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try: District & replace(replace(replace( '(' & alt(dual(P1,1), '#') & ',' & alt(dual(P2,1), '#') & ',' & alt(dual(P2,1), '#') & ')' , ',#', ''), '#,', ''),'()','')


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Try: District & replace(replace(replace( '(' & alt(dual(P1,1), '#') & ',' & alt(dual(P2,1), '#') & ',' & alt(dual(P2,1), '#') & ')' , ',#', ''), '#,', ''),'()','')


talk is cheap, supply exceeds demand
brindlogcool
Creator III
Creator III
Author

Perfect solution.... Thank you so much