I have a list of customers and there ages. I want to create four age brackets:
Age below 14
Age between 14 and 17
Age between 18 and 25
Age greater than 25
I want to count how many customers are below 14 etc. What is the best possible way to do this in the Reporter module, not in Designer. The Where operator can only use the ‘=’ operator.
Possibly easiest way is to use the grouping function, highlight the Age column in the table and use the Ctrl key to select the value for your group, you then click on the group values icon ( a sort of bulldog clip on the toolbar) or chose tools > group values from the menu bar. Repeat for each grouping.
you can then name this and edit the values further in the data map by editing the grouped values variable.
If you are using distinct ages - 14, 15, 16, 17, etc rather than 14.1, 14.23, etc then I would suggest grouping your variables.
If you have 14.1, 14.23, etc, you will need to create a separate variable that is an integer of the 14.1 and then group on the integered variable.
I use age groupings all the time in my reports and do this in a different way to that already suggested.
I create a variable as follows:
= If Between (18 ,64.99) Then (“18 - 64”) Else If Between (65 ,74.99) Then “65 - 74” Else If Between (75 ,84.99) Then “75 - 84” Else If >= 85 Then “85 plus” Else “Error”