Need help with ranking

I need to add a value to a database item which would be a ranking. In SQL I would typically use a DENSE_RANK().

In this case it is for an accounting application, which will rank transactions by date of transaction, transction type and customer.

So for example:
Ranking | Date | Type | Customer
1 | 230601 | Type A | Alred
1 | 230601 | Type A | Alfred
2 | 230601 | Type A | Bob
3 | 230601 | Type A | Caleb
1 | 230601 | Type B | Bob
2 | 230601 | Type B | Caleb
2 | 230601 | Type B | Caleb
3 | 230601 | Type B | Daniel
1 | 230602 | Type A | Aflred
1 | 230602 | Type B | Caleb
2 | 230602 | Type B | Daniel

After I create these transaction items bulk, I need to sort them and rank by these 3 criteria. How can I do this in Bubble?

I Suppose you need to create a list of groups that need to be ranked, then filter the list by each group and rank them?

I vaguely get the idea of what you’re suggesting on a theoretical level, but I am not sure as to how that would look like in Bubblish.

Thankfully, you can stack sorting options in Bubble.

The order that these are stacked will determine which sorting method get priority over the other.

This would be the results based on the current sorting.

You can access the preview of the app here.

Hope this helps point you in the right direction.

Thanks for sharing. I got the sorting part already. The question is how to calculate the rank. In your example you manually input it right?
What I’m trying to do is to calculate the rank n#.
In SQL the DENSE_RANK() function does that for you.

Right now the only way I see this could be possible is to iterate through the whole set with a closed loop workflow and calculate the rank for each item.

Do you need to store the rank or just display it? If you’re just displaying it, you should be able to display the item # of the repeating group row. Let me know if you need more info on how to do that.

Hi, it needs to be stored. Thanks for asking.