Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Im using the following variable vSubSite :
if([Site]='North Division','Sub Site 1',
if([Site]='Central Division','Sub Site 2',
if([Site]='South Division','Sub Site 3',)))
which works (I'm testing this in a Text Box).
I have a chart with the following set analysis :
=sum({ <sub_site = {'Sub Site 1'}>} Number)
which plots perfectly.
If I try and use vSubSite1 : =sum({ <sub_site = {$(vSubSite1)}>} Number) the chart fails to plot.
Is there something I'm doing wrong?
Many thanks for your time.
Tom
Put an = in front of the expressions in the variables and surround the variable expansions with single quotes. See attached qvw.
Hi,
It is due to the space contained in your variable content, which is = Sub Site 1
Insert the variable name between brackets [], sth like {[$(vsubsite1)]}
See the doc I have written: http://community.qlik.com/docs/DOC-4951
Fabrice
Try this
sum({ <sub_site = {$(=vSubSite1)}>} Number)
or
sum({ <sub_site = {=$(=vSubSite1)}>} Number)
what is value is vSubSite1 in right side.
you are assigning to same variable, that using right side in set..
try like below in variable expression,
vSubSite1 =sum({ <sub_site = {$(vSubSite1)}>} Number)
if vSubSite1 in null, then it will not show any value...
and use this in text box
sum({ <sub_site = {$(vSubSite1)}>} Number)
sum({ <sub_site = {"=$(=vSubSite1)"}>} Number)
should work
Hi Fabrice!
Thanks for your reply. This works if I hard code the variable vsubsite1 = Sub Site 1
If I try and use the expression
vsubsite1 =
if([Site]='North Division','Sub Site 1',
if([Site]='Central Division','Sub Site 2',
if([Site]='South Division','Sub Site 3',)))
then the chart doesn't plot.
Any ideas?
Tom
put the variable name between ' '
Cheers
Juan Pedro
Hi,
Thanks, but none of these solutions seem to work.
Cheers,
Tom
Hi, thanks but this solution doesn't work either (ive tried both " and ' )
Thanks,
Tom
Tom,
vEssai is a variable
= if(TIME_Key < 15, 'GAMME GOURMANDE')
As you see, there is a test (with if statement based on TIME that is chosen in a box), and the value is GAMME GOURMANDE (with a space)
sum ({<CONTENANT_LName = {[$(vEssai)]} > } [Ventes Valeur])
where
[Ventes valeur] is my variable
CONTENANT_LName my diimension
vEssai is enclosed into brackets []
So it should work.
Perhaps, it does not work in your graph because there are several Site, and the formula does not return anything
Fabrice