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: 
Qlik1_User1
Specialist
Specialist

Variable parameter with comma not working

Hi All,

I am using variable parameter but its not working when passing comma (as comma act as a delimiter for a parameter), please suggest how to remove this error

In data editor
SET vScaleNumber=if(($1)>=1000000000, num(($1)/1000000000,'#,##0.0 B') ,
if(($1)>=1000000, num(($1)/1000000,'#,##0.0 M'),
if(($1)>=1000, num(($1)/1000,'#,##0.0 K'),
($1))));

in expression

$(vScaleNumber(Sum({<id={'a','b'}>} (sales*rate))))

5 Replies
marcus_sommer

In this case you may change the set analysis syntax to:

$(vScaleNumber(Sum({<id={(a|b)}>} (sales*rate))))

and a similar approach might be also possible within another use-cases but probably not in each case.

- Marcus

Qlik1_User1
Specialist
Specialist
Author

@marcus_sommer Sorry not working getting below error

Qlik1_User1_0-1656603534664.png

 

marcus_sommer

Probably there is any bracket missing / wrongly placed - independent of the comma-topic by the variable-call. Just check this and remove the superfluous ones because the readability is suffering by them.

- Marcus

Qlik1_User1
Specialist
Specialist
Author

@marcus_sommer tried but seems some other issue still getting same error ,  as an alternative I am using like below

$(vScaleNumber(Sum({<id={'a'}+{'b'}>} (sales*rate))))

With multiple set condition like below, expression 1 is replaced with expression 2

1. $(vMoneyconversion(Sum({<id={'a','b'}, gp={'1'},name-={'N/A'}>} sales*rate)))

2. $(vMoneyconversion(Sum({<id={'a'}+{'b'}> * <gp={'1'}>* <name-={'N/A'}>} sales*rate)))

Hope this work well as well.

marcus_sommer

You are right that this are syntax-variants for a set analysis to avoid commas by listing multiple field-values and/or fields.

Nevertheless the syntax to specify multiple field-values with: (a|b) should work and didn't result into an error. I assume your real values aren't a and b and therefore you might need to wrap the values with double-quotes, for example if they contain spaces or any special chars, so in the end it may look like:

("aa-100"|"xx yyy")

You could check this logic directly against a list-box of your id-field - just activating it and writing or maybe copying the search-string.

- Marcus