Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating index values

I need to write an expression that represents the index value for given fields.

Example - I want to display the index values of actives vs inactives broken out by an age range.

So for age 18-34, the % actives is the number of actives vs all ages 18-34. Inactives is the balance. To calculate the index I would divide that % of age 18-34 that are active by the overal % of actives, and multiply by 100.

I'm not sure how to write this expression and apply it?

1 Reply
johnw
Champion III
Champion III

Something like this, maybe?

(count({<Status={'Active'},AgeRange={'18-34'}>} distinct Person)
/count({< AgeRange={'18-34'}>} distinct Person))
/(count({<Status={'Active'}> } distinct Person)
/count( distinct Person))

You don't need to multiply by 100 because you can display fractions as a percentage.

I had a hard time following, but you can use the above syntax to count pretty much any group of people you want, and then it's just a matter of doing the right math with the right group counts.