Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
ss09
Contributor III
Contributor III

Set Expression with commas inside sinqle quotes

I have a set expression as follow:

'$(=only({<adjustment_category_pss={'All entries (DEIMGs, college , school, residency ) cosmic'}>} column))'

I know this will work:'$(=only({<adjustment_category_pss={'All entries DEIMGs  return from abroad medical school residency seats'}>} column))'
How can I ignore the commas in this set expression?

Labels (2)
8 Replies
G3S
Creator III
Creator III

please try KeepChar() function 

marcus_sommer

The set expression has no problem with commas within of string-values. If it's not working it's caused from the way the expression is used - probably as parameter or within another variable. The most simple approach would be to skip these logic and not using variables for this use-case.

Aasir
Creator III
Creator III

'$(=only({<adjustment_category_pss={"$(=Replace('All entries (DEIMGs, college, school, residency ) cosmic', ',', ''))"}>} column))'

ss09
Contributor III
Contributor III
Author

But I am not wanting to get rid of the commas in my column - as that is part of the data.

 

ss09
Contributor III
Contributor III
Author

I am using variables - I have a variable Input which has a value 'All entries (DEIMGs, college, school, residency ) cosmic' and based on this value I was wanting to filter.

ss09_0-1700060025293.png.....

ss09_1-1700060047107.png

Note how after the comma - my text is getting cropped.

 

 

vincent_ardiet_
Specialist
Specialist

This is lost when you try to pass the string as a parameter, this is seen for Qlik as multiple parameters.

marcus_sommer

I expected something like this. There is no way to change the Qlik behaviour of treating them as parameter-delimiter and no way to mask them. Therefore my above suggestion of skipping this part and not struggling with any kind of technically bypassing the logic. The aim of variables is to simplify the matter and not resulting in the opposite.

Instead of using the commas like showed you may replace them with a ; or + within the possible variable-values as well as within the data (you may also double this field to show it in the origin version and using an adjusted one for the set analysis condition).

Another approach could be to replace the variable with an appropriate field from an independent island-table and then the set analysis might look like:

{< MyField = p(MySelectionField)>}

vincent_ardiet_
Specialist
Specialist

Worst case, if you have an input variable called myInputVariable. You create another one myInputVariableCorrected with =Replace(myInputVariable,',','?')
Then you can use $(vTranslateAdjustmentCategory("$(myInputVariableCorrected)")).
With the double quotes, this should work with an expression like this $(=only({<adjustment_category_pss={$1}>} column))