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

How to write an expression so selection on variable-name is excluded from computation in the expression

Assume variable "gender" with values "men" and "women"

Assume variables "age" associated with each record. Values can ge "young" or "old"

In one bar chart with 4 bars, I want to compare count on "young men" with count on "all men" and count on "young women" with count on "all women"

I think the string ($<age>=) goes in there somewhere, but I can make this work.

Help

3 Replies
Not applicable
Author

Hey Bill, in your case that can be solved with set analysis your expression should look similar to this:

count({gender = {'men'}, age = {'young'}} PersonID)

You can modify the above to get your 4 expressions.

Regards

Not applicable
Author

Hi,

you could use formulas as under:

For counting the young males = count ( if ( Gender = 'Male' and Age = 'Young' , ID,))

you would need to repeat for all the 4 criterias.

Not applicable
Author

Hi Bill, Umang approach is very straight forward and easy to understand, however I suggest trying with set analysis which is commonly faster, or even better, try both and I see what works for you.

Regards