1 Reply Latest reply: Jun 25, 2010 8:08 PM by John Witherspoon RSS

    Creating index values

    davepage

      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?

        • Creating index values
          John Witherspoon

          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.