3 Replies Latest reply: Apr 21, 2010 11:31 AM by ivan_cruz

# 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

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

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

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

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.

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

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