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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
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

 

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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