Hey, Iโm trying to list a series of calendar events grouped by month. They are sorted by the numeric value of the month (data set format looks like: 1//1/2021) -So far this works correctly, however Iโd like the eventโs marked as โNO DATEโ, to be sorted at the top in a list of newest to oldest (so it would need to in this case be seen as the 13th โmonthโ). Currently the expression is doing the exact opposite of what I want and NO DATE items end up at the bottom with oldest dates, and I canโt seem to locate documentation on the expression that would help me hereโฆ I was curious if anyone had a solution?
IF(ISBLANK([Event Date]),โNO DATEโ,CONCATENATE(
SWITCH(
MONTH([Event Date]),
1,โJanuaryโ,
2,โFebruaryโ,
3,โMarchโ,
4,โAprilโ,
5,โMayโ,
6,โJuneโ,
7,โJulyโ,
8,โAugustโ,
9,โSeptemberโ,
10,โOctoberโ,
11,โNovemberโ,
12,โDecemberโ,
โโ
),
" ",YEAR([Event Date])
))
Solved! Go to Solution.
Add a virtual column to the table with an App formula expression of ISNOTBLANK([Date])
. Add the column to your sort columns but do not display it.
I believe AppSheet groups by digit value and alphabetically. So , if you have dates with September and October, I believe โNo Dateโ group will appear in between before those months because N is alphabetically before O and S.
So if you wish just โNo Datesโ to apepar at the top, you could attach a digit before โNo Dateโ such as โ0-NO DATEโ
Also with your current naming convention, April and August dates will appear before February and March and so on.
You may wish to attach month digits before month names to sort the grouped dates by month in alphabetical order.
Also you may wish to use the TEXT() function to simplify the expression as below
IF(ISBLANK([Event Date]),โ0-NO DATEโ,TEXT([Event Date], โMMMM YYYYโ))
The following will add a digit corresponding to the month before month year names
IF(ISBLANK([Event Date]),โ0-NO DATEโ,TEXT([Event Date], โM- MMMM YYYYโ))
The dates in the actual data columns are numeric. This just converts the numeric version into each proper spelled out month, then sorts the months appropriately. Just NO DATE goes at the bottom after the oldest dates.
Could you elaborate what you mean by numeric dates?
In the actual data columns the dates are formatted like 1/1/2021 or mm/dd/yyyy
This expression assigns a month to each number, and parses out the year. I have the table grouped by month so it displays groups of calendar events within January 2021, Feb 2021, March 2021, etc
So itโs still sorting by number, but putting NO DATE after any number sorting. The only way to get it to sort to the top with a number would be to somehow assign โ13โ next to NO DATE in itโs current configuration as opposed to โ0โ as you suggested.
Okay, thank you, In that case, all that I mentioned in my earlier post is valid.
โNO DATEโ will sort before September and October months.
Also I request you to try the shorter version of the expression that is exact alternative to SWITCH() based expression.
No the table is sorting numerically. Top to Bottom: 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, NO DATE; with each number assigned to a month, and starting again each year change, with null dates at the end. It is NOT sorting Alphabetically.
I need it to sort like NO DATE 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
Here is a screen shot of it properly sorting the months by number, not alphabetically.
Oh okay, thank you. In that case you may attach 0 to the โNO DATEโ such as โ0-NO DATEโ or โ13-No DATEโ and still try the expression
IF(ISBLANK([Event Date]),โ0-NO DATEโ,TEXT([Event Date], โMMMM YYYYโ)) which I believe is exact equivalent of the below except for โNO DATEโ preceded by a 0 or 13
IF(ISBLANK([Event Date]),โNO DATEโ,CONCATENATE(
SWITCH(
MONTH([Event Date]),
1,โJanuaryโ,
2,โFebruaryโ,
3,โMarchโ,
4,โAprilโ,
5,โMayโ,
6,โJuneโ,
7,โJulyโ,
8,โAugustโ,
9,โSeptemberโ,
10,โOctoberโ,
11,โNovemberโ,
12,โDecemberโ,
โโ
),
" ",YEAR([Event Date])
))
Edit: Minor changes in description
Hi, i am trying to achive what you show here. But i am getting the alphabetical order anyway... this is the formula and the view setting.
Hereโs a picture of what I mean. But NO DATE labelled events are currently at the bottom of this list
Add a virtual column to the table with an App formula expression of ISNOTBLANK([Date])
. Add the column to your sort columns but do not display it.
Thatโs brilliant man. Thank you so much!
User | Count |
---|---|
15 | |
9 | |
9 | |
7 | |
3 |