-
Set analysis issue using variable.
Perumal Ayyappan Mar 30, 2012 9:11 AM (in response to briansteffens)Hi
try this method u get answer .i will thing
Variable : vVar = '=GetfieldSelections(Category)'
count({1<MAINCategory={'$(vVar)'}>}MAINCategory)
Regards
Perumal A
-
Set analysis issue using variable.
Celambarasan Adhimulam Mar 30, 2012 9:27 AM (in response to briansteffens)Hi,
Can you post the table structure?
I think its better if you link the Category and category groups internally by using same field name.
Celambarasan
-
Set analysis issue using variable.
briansteffens Mar 30, 2012 10:24 AM (in response to Celambarasan Adhimulam )Didnt work Perumal A. Thanks though i think thats something to remember for the future!
Hey Celambarasan, thanks for your reply linking them would be a good idea according to what I posted. I forgot to mention that im going to be using 2 graphs on a comparison sheet. I dont want either graphs selection/filters to affect the other. Thats why I used seperate tables to do the filtering off.
The problem is that my Set Analysis statement works if i input a text value instead of using the variable (ie use Red Apples) instead of vVar in the Set Statement.
Thanks for the quick replies!
-
Set analysis issue using variable.
Celambarasan Adhimulam Mar 30, 2012 10:34 AM (in response to briansteffens)Hi,
Which version of qlikview are you using?
try like
Chnge your variable expression as = GetfieldSelections(Category,',')
=count({1<Category={$(vVar)}>}Category)
Celambarasan
-
-
-
Set analysis issue using variable.
Jonathan Dienst Mar 30, 2012 10:04 AM (in response to briansteffens)Brian
Is there a particular reason for not associating the tables? If not, that would be faster and simpler than what you are trying to do.
Assuming there is a reason, I don't think you need a variable to do this. Rather use the P() function in the set analysis. Something like:
Count({<MAINCategory=P(Category)>} MAINCategory)
This will cause MAINCategory to be limited to the possible values of Category (if Category is one of the fields in the listboxes.
But you can't use Category as the dimension in the graph with set analysis. The set analysis is performed BEFORE the chart is constructed, so is unaware of the dimensions. In other words, the data passed to the chart already has the set analysis performed on it.
Regards
Jonathan
-
Set analysis issue using variable.
briansteffens Apr 2, 2012 3:37 AM (in response to Jonathan Dienst )Thanks Jonathan.
Using P in the set analysis seemed to do the trick!! I hope i dont get stuck with this kind of thing again though. Not sure why the variable wasnt getting accepted as is.
Sorry you were right about the dimension as well. I just made up the apples example as the data is a bit sensitive, i wasnt actually using category as the dimension
-