Averaging Star Ratings in Knack - Watch out for this!
- Dave Parrish
- Jun 1
- 3 min read
Hello!, Dave Parrish here with KnackBuilders. Today I want to dive into a quick but important topic that might trip you up if you're using the star rating field in a Knack database —specifically when you’re calculating averages. I ran into something that didn’t behave quite the way I expected, so I thought I’d walk you through what’s going on and how I solved it.
Why I Use Star Ratings (and Where It Got Tricky)
I use the star rating field a lot—for things like surveys, performance reviews, or skill assessments. It’s visually intuitive and works well for instructors and users who just want to click and move on.
But here’s the catch: when you start averaging star ratings, especially across child records (like student scores in a class), the result can behave in unexpected ways. I noticed something odd when trying to compare individual student performance to class averages.
Real Example: Swim School Skill Tracking
Let me show you the actual scenario. I’ve been working with a swim school app. It tracks classes, students, and various swim skills. Instructors rate students using the star field across skills like floating, kicking, etc.
The goal was to show each student’s skill rating next to the class average for comparison. Simple enough, right?
But when I tried averaging the star ratings across a class and displaying that average in a field—it showed up as stars, not as a numeric value. That doesn’t work when you're trying to build a tight, easily scannable table of data.
What Was Actually Happening Under the Hood
Here’s what was going on:
The star rating is visually helpful, but it's not ideal when you need to calculate and compare values.
When you use a formula to average child records (e.g. all student ratings in a class), the result is still treated as a star field on the front end.
You can’t really consume an average visually if it’s just a bunch of stars—especially when they don’t support half-stars in that context.
So if a student scored 4 stars and the class average was 3.5, it just wasn’t displaying clearly. It needed to be numeric.
The Fix: Matching Number Fields with Conditional Rules
Here’s how I fixed it:
I created a matching number field for each skill I wanted to average.
I added a condition to that number field so that it simply pulled in the value of the star rating average from the child records.
By doing that, the field displayed the average as a clean numeric value (e.g. 3.7), not stars.
Now I could build concise tables showing a student's rating and the class average side by side—in numbers, not stars.
Yes, It’s Tedious—but It Works
It wasn’t the most glamorous fix. I had to create a matching number field for every skill, and repeat the process for both the individual students and the class averages. But once I did it, the layout made sense and was easy to read.
And best of all—it worked.
In Summary
If you’re using star ratings and running into weird issues with averages, here’s the takeaway:
Star ratings look nice, but don’t average cleanly.
Use a number field to mirror the star value if you need to do math or display averages.
Apply a conditional rule to pull the star rating’s numeric value into that number field.
It’s a little more setup work, but it makes your tables readable and your data reliable.
That’s it for today—short and sweet! Hope this helps if you run into the same quirk. Let me know if you’ve found other workarounds—I’m always looking to learn more.
Interested in my Knack database services? ... Book a call with me here: https://calendly.com/daveparrish/callwithdave
Comments