Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Remove expression based on filter selection

I am in the process of trying to build a chart which shows values for a customer against the market average. Due to data confidentiality, the market average can only be filtered by one dimension (in this case "Class Of Business"), so what I would like to be able to do is hide the market average expression if the data is filtered on any dimension other than "Class Of Business".

Unfortunately I can't think of a way to achieve this. Has anyone got any ideas?

Hopefully I've been clear in what I want to achieve.

11 Replies
khadeer
Specialist
Specialist

Hi,

Try aggr("ur expression", "dimension")

Aggr(market average, Class of Business)

Hope it will help u.

Anonymous
Not applicable
Author

Thanks, but unfortunately that hasn't worked.

What I didn't mention was that this is a trend chart, with the expressions spread over a time period (in this case year and month). With the Aggr function added, I lose market average values for certain months, and filtering the data on anything other than Class Of Business isn't hiding the expression.

Not applicable
Author

Hello,

In your expression, you can use the set analysis like this :

{1<[Class Of Business]=$::[Class Of Business]>}

For example :

sum({1<[Class Of Business]=$::[Class Of Business]>} [Another field])

Amand Dupretz

Anonymous
Not applicable
Author

Again, thanks for your assistance, but I'm getting a syntax error with this.

Not applicable
Author

Can you describe your problem please ?

Where is the syntax error ?

Amand Dupretz

Anonymous
Not applicable
Author

Please see the attached image. I am developing in Qlikview 10, SR1 by the way.

SetAnalysisError.JPG

Gysbert_Wassenaar

If you're using QV10 then you can't use the alternate states syntax in your set expressions. You're also missing conditional display options for expressions. So probably the only course of action is to use two charts and show one chart if there are no selections in Class Of Business and hide the other. And reverse that when there are selections in Class Of Business.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Thanks. I was already coming around to this way of thinking, but was there was an alternative solution.

Thanks to everyone for their assistance though.

Anonymous
Not applicable
Author

Sorry, I've gone and stumped myself again.

So I want to show a chart if NO selections have been made or it ONLY Class Of Business has been selected. Any other combination of field selections should result in hiding the "Market Average" chart.