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: 
Not applicable

Set Analysis - Expression

How can we write a set analysis in expression for displaying only those values of a field 'Field1' which are equal to 10?

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

=if(Index(Concat(Reference,'|'),Year)=0 ,NumberOfSchools)

View solution in original post

9 Replies
rajeshvaswani77
Specialist III
Specialist III

You will use Set Analysis where you need a aggregation. Not in this case. You can use a if condition here.

Thanks,

Rajesh Vaswani

anbu1984
Master III
Master III

Sum({<Field1={10}>}Field2)

Not applicable
Author

Please see the attached file. In the combo chart, I want that for the Year '2002', bar should not be displayed. Condition for the expression that I've written is: if(Year=2002,'0','1')

Please check what's wrong here.

Thanks!

anbu1984
Master III
Master III

if(Year<>'2002',NumberOfParks)

if(Year<>'2002',NumberOfSchools)

rajeshvaswani77
Specialist III
Specialist III

Hi Nishant,

Check attachment, have added the condition in the dimension. The else part i.e. 2002 will become null. Have suppressed nulls for dimension then.

thanks,

Rajesh Vaswani

Not applicable
Author

Hi Anbu

Thanks for your reply. I made it using your approach. I made a slight change because for Year 2002, I just don't need bar. But line should always be displayed (even for Year 2002).

But I have a small doubt again. Please check the file attached. Instead of hard coding a value like in if(Year<>'2002',NumberOfParks), I would like to get '2002' from a field. This time the field can have more than 1 values. For example in the attached example, I have two values '2001' and '2002' in the Reference field. How to take these values into account?

Thanks!

Not applicable
Author

Hi Rajesh

Thanks for your reply but I didn't want my dimension to disappear from display. That's whyI don't use condition in Dimension. However I have the problem of using filter value from another field. Please see the attached example. I have two values '2001' and '2002' in the Reference field. How to take these values into account for filtering bar in the combo chart?

anbu1984
Master III
Master III

=if(Index(Concat(Reference,'|'),Year)=0 ,NumberOfSchools)

rajeshvaswani77
Specialist III
Specialist III

Hi Nishant,

Anbu has given the correct answer.

thanks,

Rajesh Vaswani