Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have two variable define as below
vUserlist = Concat(distinct name,'|')
vUserfilter= SubField($(=vUserlist ),'|',$1)
the default meseare is sum(sales)
I would like to sum sales where for specific names based on a dynamic list. this is because we have an exact number of names and would like to have differenct charts for each name without using Qlik's Trellis which doesn't work properly.
I have tried Sum({<name={"$(vUserfilter(1))"}>}sales) but it is not working.
Any suggestion how I can make this work?
I've tested as below and it works
vList
=concat(distinct ID,'|') <--with leading = sign
vFilter
=concat(distinct Year,'|') <--with leading = sign
My Expression
count({<ID={"$(vFilter(1))"}>} Number)
pretty close, just add the single quotes
vUserfilter= SubField('$(=vUserlist )','|',$1)
Side note, selected values will not be concatenated in the order of selection, and there is no workaround to do so
I tried it but still it is returning the total for all names. see the sample code below.
testtable:
Load * Inline [Year,name,sales
2010,frank,2000
2010,eric,2500
2011,frank,7000
2011,eric,7500
2012,frank,3000
2012,eric,3500
2013,frank,4000
2013,eric,4500
];
Bar chart
dimension is Year
Measure is
Sum({<name={"$(vUserfilter(1))"}>}sales)
Variables
Hi,
I have switched my variable to be
vPickName = Pick(1, $(=Concat(distinct Chr(39) & name & Chr(39), ', ')))
and Sum({<name={"$(vPickName)"}>}sales) Works fine
BUT to make it dynamic so I can parse the pick number I used
vPickName = Pick($1, $(=Concat(distinct Chr(39) & name & Chr(39), ', ')))
Sum({<name={"$(vPickName(2))"}>}sales) and it doesn't work.
Please what am I am missing? it seems Pick doesn't allow parsing a variable as the number?
define the variables with a leading = (equal sign)
I've tested as below and it works
vList
=concat(distinct ID,'|') <--with leading = sign
vFilter
=concat(distinct Year,'|') <--with leading = sign
My Expression
count({<ID={"$(vFilter(1))"}>} Number)