Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
felcar2013
Partner - Creator III
Partner - Creator III

Dollar sign expansion with parameter not working

hi

i defined a variable like:

set vParameter =num(sum({$<%cus_track_wave__ID={'$(vLastWave)'},%cus_track_buyer__ID={$1}>}cus_track_qualityassessment)/count({$<%cus_track_wave__ID={'$(vLastWave)'},cus_track_quality={1,2,3,4,5,6,7},

%cus_track_buyer__ID={$1}>}cus_track_quality),'#,##0%');

and use it in the chart, under "Presentation" / add text as :

=$(vParameter(2)), where 2 is the buyer_ID

but it does not work. I need to use the formula as it is:

=num(sum({$<%cus_track_wave__ID={'$(vLastWave)'},%cus_track_buyer__ID={2}>}cus_track_qualityassessment)/count({$<%cus_track_wave__ID={'$(vLastWave)'},cus_track_quality={1,2,3,4,5,6,7},%cus_track_buyer__ID={2}>}cus_track_quality),'#,##0%')

where

set vLastWave ='= MaxString(%cus_track_wave__ID)';

Results for a filter is like this: the full Formula is getting what i need, but not the vParameter. The $(vParameter) shows me 53% instead of 64%,

DimensionvParameterFormula
Apr 201347.06%-
May 201370.00%-
Jun 201344.44%-
Jul 201364.29%64.29%
Total52.94%64.29%

any idea, what i did wrong?

many thanks

5 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Check this hope it helps you.

http://community.qlik.com/docs/DOC-3836

Regards,

Jagan.

Not applicable

Hi Felipe,

within SET Analysis "$1" is a keyword, which means the previous selection. So I suppose the parser interprets it in this way and "forgets" the possible second meaning (being a parameter).

Hope this helps

Roland

rlp
Creator
Creator

Given that, the variables are substituted, whether you use LET or SET, every time the QlikView interpreter encounters a dollar sign, it tries to interpolate a variable. to prevent such an attempt, you should cut your string in two parts and insert the dollar sign via its ascii code with chr(30).

felcar2013
Partner - Creator III
Partner - Creator III
Author

Hi

thanks for this, i was away all September. Yes, it make sense, why it did not work, same as Rolands comment. Better use of chr().

cheers

felcar2013
Partner - Creator III
Partner - Creator III
Author

thanks for this Roland, make sense

Felipe