Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Discretion: new to QlikView, so please be kind!
I would like to control which selection fields affect a chart without using alternate states. I believe this restricts me to set analysis. Browsing other questions it seems the generic code for this is something like...
SUM( {< Year = P(Year) >} Cost )
...however my dilemma is that the set of possible Year values, P(Year), could be restricted depending on other field selections. For example, if the current Month is "August", and "December" is selected in a Listbox, then the current year is no longer possible and therefore excluded from the set. How do I get around this?
Ideally, I would like to be able to choose which fields can filter the specific chart object without interference from other fields.
Thank you in advance!
I think what you want is:
=sum({1<Year=$::Year>}Cost)
that would use only the selections in Year.
-Rob
Hi,
If you don't be able to use "Alternate States" use set analysis specify don't use certain fields:
Example: I need Sales from all fields except Year ... so my expression will be:
Sum({<Year=>}Sales) // Year= return Sales from all selection in all fields excpet Year, until you have a selection in Year field you get a result from all years.
Example2: I need Cost of my product 5 but I need don´t use selections in Country field so my expression will be:
Sum({<Product={5}, Country=>}Cost) // return Cost of Product in all Country even you have a selection in Country field.
Best regards.
Your examples tells me how to exclude a field from use but if I have a long list of fields the code can get quite long and difficult to maintain
Is there a way I can limit to say... Sum costs by Year, and ignore all other field selections?
I think what you want is:
=sum({1<Year=$::Year>}Cost)
that would use only the selections in Year.
-Rob
Thanks Rob
Worked like a charm and is a much more direct approach!