Aug 08, 2021 05:44 AM
I am having trouble sorting a list of records in chronological order by date using a field that I have formatted with a formula that calculates the day of the week, month, day of month. The sort is defaulting to alphabetical.
The formula I’m using is
CONCATENATE({Start Day},", ",{Start Date})
Start Day Formula is:
DATETIME_FORMAT({Start Date & TIme},‘dddd’)
Start Date formula is:
DATETIME_FORMAT({Start Date & TIme},‘ll’)
I’m running into an issue as I go from month to month that aren’t in alpha order (sept to oct for example is being listed with oct first. I feel that if I change the formula I sort by to a DATETIME_FORMAT then this could be fixed but I can’t figure it out. Any help or direction would be greatly appreciated!!
Thanks!!
Aug 08, 2021 07:04 AM
Welcome to the Airtable community!
Is there a reason why you are not sorting on the original date/time field?
If you want to sort on a DATETIME_FORMAT
result, it will sort alphabetically, so you need to format using numbers only (YYYY-MM-DD
)
Aug 09, 2021 06:36 AM
i’m not using the original date/time field because i want the day of the week to be included.
Aug 09, 2021 02:41 PM
try ‘d-dddd’ behind your datetime format for start date
Aug 09, 2021 07:54 PM
How do you want the day of the week to be included in the sort?
If you want the day of the week for display purposes, you can still sort on the original date field, and but just display the formula field with the day of the week. You can sort on a hidden field.
Aug 10, 2021 12:46 AM
I’ve not had luck with sorting from a hidden field. Is this due to the fact that I have the records grouped. It seems that I am not allowed to sort by a field that is not a part of the grouping.
Further explanation:
I am grouping by “week #” field and then by “Start Day, Date” field.
“Week #” field is single select
“Start Day, Date” field. is:
CONCATENATE({Start Day},", ",{Start Date})
Aug 10, 2021 08:33 AM
Grouping and sorting are different but related features. Both grouping and sorting can happen on hidden fields. If you use both grouping and sorting, the grouping happens first (with groups sorted according to the sort specified in the grouping), and then any additional sorting happens within the lows level of grouping.