Rank vs Row Number (and Divide into Groups)
Rank, Row Number and Divide into Groups all give a record a position. They look alike, and the difference is what happens on a tie. Here is when to use each one in a Tadabase Rollup field.
On this page
In this video
- The idea, from a race podium: a rank says how many people beat you
- Rank in a data table, including the tie and why the next rank is 4, not 3
- Row Number, which never shares a position
- Divide into Groups (NTILE) for top, middle and bottom thirds
- Ranking within each group
- How to set it up in the AI Builder
- 3 rules: direction decides the winner, Row Number ties can flip, uneven groups fill the first groups
Chapters
- 0:00 Rank, Row Number and Divide into Groups
- 0:13 The idea: a race podium
- 0:33 Rank in a data table
- 0:58 Row Number
- 1:18 Divide into Groups (NTILE)
- 1:37 Ranking within each group
- 2:00 Setting it up
- 2:22 Rule 1: direction decides the winner
- 2:37 Rule 2: Row Number ties can flip
- 2:51 Rule 3: uneven groups
- 3:02 Recap
Read the docs
- Summarize connected records with a Rollup field Count connected records, or total, average, find the lowest or highest of, or list a field across them, with optional conditions.
- Window Functions Complete Guide Window Functions are powerful analytical tools that allow you to perform calculations across rows that are related to the current row. Unlike regular…
Transcript
Show the full transcript
0:00 Rank, Row Number and Divide into Groups
Let's look at ranking. Three Rollup functions give every record a position: Rank, Row Number, and Divide into Groups. They look alike, and the difference is what happens on a tie.
0:13 The idea: a race podium
Think of a race. First, second, third. Ana is fastest, Ben is next, Cai is third. That is a rank. But if Ben and Cai finish at the exact same time, they share second place, and nobody is third. A rank says how many people beat you.
0:33 Rank in a data table
In a data table, Rank follows the Order By field. Here are five students, highest score first. Rank counts who is ahead. Maya, nobody ahead, rank one. Omar, one ahead, rank two. Lena ties with Omar, so she shares rank two. Theo has three people ahead of him, so he is rank four, not three. Ravi is five.
0:58 Row Number
Row Number never shares. It numbers the line in order, one, two, three, four, five, even on the tie. Like tickets at the deli counter. Put them side by side. Rank gives Omar and Lena the same position. Row Number gives them two. Everywhere else, they agree.
1:18 Divide into Groups (NTILE)
Divide into Groups puts records into buckets of roughly equal size. Take the same five students, ask for three groups, and the top scores land in group one, the middle in group two, the rest in group three. That is how you make top, middle and bottom thirds.
1:37 Ranking within each group
Any of the three can restart per group. Here are support tickets with a priority. Rank them by hours, grouped by priority, and the high-priority tickets get their own one, two, three, while the low-priority ones start again from one. Where does this help? Top sellers this month. A place in the queue. Top, middle and bottom thirds of your customers.
2:00 Setting it up
Setting one up takes a few choices. Add a Rollup field on the table itself. Turn on Show All Tables, and pick this same table. Choose Rank. There is no value field. Rank only needs an order. Pick Order By, and the direction. Highest first means descending. Save, and every student gets a rank.
2:22 Rule 1: direction decides the winner
Three rules to keep track of. Rule one: direction decides the winner. Order by score ascending, and the lowest score is rank one. Descending, and the highest is. Same scores, a different winner. Highest first means descending.
2:37 Rule 2: Row Number ties can flip
Rule two: Row Number on a tie can flip. Omar and Lena both scored ninety-one. The next time the field recalculates, they can swap numbers. If that matters, break the tie with a second field, like the record ID.
2:51 Rule 3: uneven groups
Rule three: when the rows do not divide evenly, the first groups get the extra rows. Five students in three groups is two, two, and one.
3:02 Recap
That is ranking. Rank counts who beat you. Row Number counts the line. Divide into Groups splits the pile. Next up: the row before and the row after, with Previous Value and Next Value. Learn more at tadabase.com.
Also on Vimeo · the whole series on Vimeo