Want to make your average rating data easier to read and compare?
This calculation helps you do just that by grouping decimal-based ratings into simple whole-number buckets. So instead of dealing with messy scores like 4.2 or 3.7, you’ll have clean, easy-to-understand values like from 1 to 5.
It’s perfect for building dashboards, reports, or charts that show trends in user feedback or review data, and it makes filtering by rating much more straightforward.
Please see below for the benefits and steps to get started.
Groups fractional ratings into standardized, whole-number values
Enables clearer insights into rating trends
Makes it easier to create visualizations like bar charts or filters
Helps avoid excessive granularity in rating data
In this example, we'll be working with the Average Rating metric but the same logic can be applied to any numerical value that you want to bucket or round into ranges.
Navigate to Data in the left-hand menu, then choose Calculations and press the + button.
You will then need to fill out the prerequisite information at the top with the data source name and data view.
Switch to Text Editor view using the toggle below
Paste in the logic on the right to assign average ratings to discrete groups, then toggle off the text editor view.
Tip: Use quotes around the outputs (e.g., "1") if you want to treat the result as text (e.g., for labels or dimension groupings).
IF {Average Rating}>=1 AND {Average Rating}<=1.9 THEN
"1"
ELSEIF {Average Rating}>=2 AND {Average Rating}<=2.9 THEN
"2"
ELSEIF {Average Rating}>=3 AND {Average Rating}<=3.9 THEN
"3"
ELSEIF {Average Rating}>=4 AND {Average Rating}<=4.9 THEN
"4"
ELSEIF {Average Rating}>=5 THEN
"5"
ELSE
"0"
END
Test the calculation and save it by pressing the button at the bottom of the page.
Add the new calculation dimension to your dashboard widgets and reports.
There is often more than one way to solve a problem in the Tapclicks platform, so it's important to consider how each one could impact the performance of your instance. Here are some key points to keep in mind:
Advanced calculations: While powerful, advanced calculations can slow performance with large datasets. Use simpler calculations when possible and reserve advanced ones for when necessary to maintain efficiency.
Limit CASE statements: Keep CASE statements to 10 branches or fewer. Larger ones can slow processing, so simplify or break them into smaller segments for better performance.
Data lookups for large conditions: For complex conditions, consider using data lookups from external sources like Google Sheets to simplify logic and improve performance.