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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tmap String Expression concatenate multiple input columns into one output column by checking for blanks and NULLS and one distinct value "UNKNOWN"

Need to concatenate multiple input columns into one output column by checking for blanks and NULLS and one distinct value "UNKNOWN"

 

Multiple input columns of mine contain codes that I need to concatenate together no spaces inbetween values. Also to change blank values to those concatenated strings and values in that mpf1 column that have "UNKNOWN"

Do I have the concatenation right?

Will "Unknown" and blank strings going to be outputted with the 6 concatenated strings with this syntax below?

 

"Unknown".equalsIgnoreCase(row1.mpf1) || "".equalsIgnoreCase(row1.mpf1)? row1.mpf1 + '' + row1.mpf2 + '' + row1.mpf3 + '' + row1.mpf5 + '' + row1.mpf6 :  row1.mpf1 + '' + row1.mpf2 + '' + row1.mpf3 + '' + row1.mpf5 + '' + row1.mpf6

 

Thanks

 

Andrew

Labels (1)
  • v7.x

1 Solution

Accepted Solutions
fdenis
Master
Master

((String)((row1.mpf1!=null && row1.mpf1.equalsIgnoreCase("Unknown"))?"":row1.mpf1) + row1.mpf2 + row1.mpf3 + row1.mpf5 + row1.mpf6)
assume that it's a String

View solution in original post

2 Replies
fdenis
Master
Master

hi,
((row1.mpf1!=null && row1.mpf1.equalsIgnoreCase("Unknown"))?"":row1.mpf1) + row1.mpf2 + row1.mpf3 + row1.mpf5 + row1.mpf6
is better.
in java "" string is null.

Regards,
fdenis
Master
Master

((String)((row1.mpf1!=null && row1.mpf1.equalsIgnoreCase("Unknown"))?"":row1.mpf1) + row1.mpf2 + row1.mpf3 + row1.mpf5 + row1.mpf6)
assume that it's a String