Category / Section
How to group data by age range and display in a chart
Published:
Grouping data by age range lets you compare the values of different age groups and identify any trends easily. This is particularly useful when dealing with large datasets that need to be analyzed or presented in a meaningful way. For example, here we have grouped the data by patients' age range.
Steps to group data by age range
- Drag and drop the Stacked Column Chart to the designer canvas. You can also choose any other charts and tables.
- Navigate to its Assign Data section and configure the Value(s) and Row sections with Patient_Id and Gender columns respectively.
- To create age ranges, create an expression column named "Age Group" with the following expression. This will group the ages based on the criteria added to the expression.
IF([Age]>0 AND [Age]<10,'0-10',IF([Age]>10 AND [Age]<=30,'10-30',IF([Age]>30 AND [Age]<40,'30-40',IF([Age]>= 40 AND [Age]<50 ,'40-50',IF([Age]>=50,'Above 50','0')))))
4. Drag and Drop this expression column to the Column(s) section as shown:
5. Now, data will be grouped by age range as shown: