Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
felcar2013
Partner
Partner

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
Partner
Partner

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
Partner
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
Partner
Author

thanks for this Roland, make sense

Felipe