Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

felcar2013
Not applicable

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
Not applicable

Re: Dollar sign expansion with parameter not working

Hi,

Check this hope it helps you.

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

Regards,

Jagan.

Not applicable

Re: Dollar sign expansion with parameter not working

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

richard_pressan
Not applicable

Re: Dollar sign expansion with parameter not working

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
Not applicable

Re: Dollar sign expansion with parameter not working

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
Not applicable

Re: Dollar sign expansion with parameter not working

thanks for this Roland, make sense

Felipe