Group data in a table view and sort the groups by another data

Hi!

I’m having trouble sorting my data in a table view.

I have a view called Tasks where it shows tasks assigned to certain people. It has some data, such as the name of the person, the task assigned, and the event in which the task should be done.

That event is a reference from another table, and it has a date and a name.

So in this Tasks view, I want to show the tasks grouped by event, but sorted by the date of the event. To explain it better I’ve attached an image.

I’d like these tasks to stay grouped by the event name, but also that these events were not sorted by their first letter, but from the date they were set to. What could be a workaround for this?

Thank you very much for your help!

I believe this can be achieved by the provided Table view. It has a Sort property, so that all rows can be sorted by the Event Date. And in Group By property you would use Event Name to form a view similar to your example.

Did you see an issue using this view? If so, what was the problem?

1 Like

When grouping, the groups can only be ordered by the group name; you cannot group by one value but display another.

To accomplish what you want, you will need to prefix the group name with a number that will sort as desired (e.g., 1-Event A, 2-Event B).

3 Likes

Thank you Steve, it’s a good workaround.
It could be nice if it detected which columns are references so it let me sort them no just alphabetically but also by another linked data.

I’ll try the Feature requests page for that.

Thank you!

Hi John

Yes, I tried to sort and group it in the Table view, in the UX page.

Unfortunately, it treats them separately. When I chose to group them by the event name, the sort option works for the data that is inside a group. What I want to achieve is to sort the groups, not the data inside of them. And when I choose to sort these groups, the only option is alphabetical order :disappointed:

I’ll try the Feature requests page to see if this could be an option.

Thank you for your help! :raised_hands:

But this only works within expressions.

Maybe I’m not understanding the problem.

First, as I re-read, there seems to be a contradiction. Your sample pic shows Events in alphabetical order and the date, written off to the side, are NOT in chronological order. However, your text reads “but also that these events were not sorted by their first letter, but from the date they were set to”.

If it is the case that sorting by name nor date is sufficient and there is no other data attribute you can sort by, then @Steve is correct, you MUST add a data attribute to allow a custom sort.

@Steve suggested adding a prefix to the Event Name and that is one way to handle the sorting problem. If you do not want to show the sort info in your Group Header, then simply add a column that is solely used for sorting and never shown anywhere.

Once you have your data attribute added, regardless of which way you add it, you simply sort by that column and then group by Event Name and your done!

2 Likes

It’s been a couple years since answered, wanted to check in and see if anyone found a better solution. I’ve got a Deck View grouped by User Name (concatenations of First and Last). However, I want to sort the groups by Last Name.

I realize I could order the Username Last, First in the concatenation and sort this way but this doesn’t look as good as a persons whole name listed.

Thoughts?

1 Like

That’s the only alternative. :frowning: