Month and Year Desc

Hi Guys.
You’ve probably been asked a miilion times, but I can’t find the right way to resolve this.
Daily invoice totals grouped by MMMM,YYYY descending

In my app I have (not probably the right one) this expression in a VC called ‘Month Order’:

CONCATENATE( INDEX( LIST(“Jan”, “Feb”, “Mar”, “Apr”, “May”, “Jun”, “Jul”, “Aug”, “Sep”, “Oct”, “Nov”, “Dec” ), MONTH([InvoicedDate]) ), " ", YEAR([InvoicedDate]) )

And in the view:

But the result in the app is:

I realise this is TEXT descending but I can’t find a way to have the results in the correct Date descending order. Can you guys assist please.

Kind Regards

As per my understanding, there is no very elegant solution for this requirement. One not so elegant workaround could be to have the year month digit numbers precede the month year description. If all the data is in the 21st century, the century part may be dropped from the year in the preceding sorting digits, thereby making the preceding sorting digits length of max 4 digits

The expression for the group by field can be something like
CONCATENATE("(", TEXT([InvoicedDate], “YYM”), ") ", TEXT([InvoicedDate], “MMMM YYYY”))

1 Like

Hi Suvrutt, the following helps but doesn’t give me the Month as Text:

CONCATENATE(YEAR([InvoicedDate]),"-",IFS(MONTH([InvoicedDate])<10, “0”),MONTH([InvoicedDate]))

But this does work, ideally it would be good to see the month however we can live with this.

Oh okay. Thank you Dave for your updates. The general idea will be to add some properly sorting prefix to month year description as months otherwise sort alphabetically and not in their calendar order.

Yes, I agree that one needs to choose the best option that suits the app users.

1 Like