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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
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
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