Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to allow only certain fields affect a chart?

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!

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think what you want is:

=sum({1<Year=$::Year>}Cost)

that would use only the selections in Year.

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

4 Replies
Not applicable
Author

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.

Not applicable
Author

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?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think what you want is:

=sum({1<Year=$::Year>}Cost)

that would use only the selections in Year.

-Rob

http://masterssummit.com

http://robwunderlich.com

Not applicable
Author

Thanks Rob

Worked like a charm and is a much more direct approach!