Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Pick(Match()) is not working properly in assigning a number format

Hi, everyone,

I am trying to assign an Pick_match expression in the format paremeters in the num function. This expression is assigned to a variable called vFormat and it gives a format of M (millions), k, (thousands) or normal. The variable vDivision assigns a value of 1,1000 or 1000000 depending on the case. 

The problems is this expression works correctly like this:

NUM(Sum(Measure)/$(vDivision),PICK(MATCH($(vDivision),1000000,1000,1),'#,###.## M','#,###.## k',''))

But not with this format:

NUM(Sum(Measure)/$(vDivision),'$(=$(vFormat))')

NOR $(vFormat), '$(vFormat)',$(=$(vFormat)),'$(=$(vFormat))'

I attach also a qvf file with the example

Thanks in advance for your invaluable support.

P.S. The variables must be defined on a qvs file/script. 

ImageComparison.PNG

 

Labels (2)
2 Replies
Highlighted
Partner
Partner

When you set vFormat in the script, it is evaluating vDivision immediately:

SET vFormat =PICK(MATCH($(vDivision),1000000,1000,1),'#,###.## M','#,###.## k','');

As a result, if you look at the value of vFormat in the Variable overview, you can see it has a hardcoded value rather than a reference to vDivision:

PICK(MATCH(1000,1000000,1000,1),'#,###.## M','#,###.## k','')
Highlighted
Creator II
Creator II

Thank you for your answer. Is there a way of loading a variable inside another variable from a script/qvs file and avoiding the hardcoding of the value?