I have a table containing Month column...when I apply sort and when user click on the month column the table should sort according to the month wise...not alphabetic order... ex Jan, Feb ,march, so on....and also it should fetch the current month and display records having month column of current month first then again rest records month wise...
ex: sorting like Jan,Feb,March,,,
If for ex: current month is Nov, then recording having Nov month should display first then records of dec, jan,Feb should appear
For that you need to add a filter to exclude all records with the date older than the first date of the current month. Get the first date of the current month: NewDate( Year(Date), Month(Date), 1)
So agggregate date >= NewDate( Year(Date), Month(Date), 1)
You could also filter on year+month combination.
Hi Akshata,
For that you need to make sure to have the Month Number and the Year in your aggregate, then you can sort on year then month number, but display the month abbreviation. You can use the Year() and Month() build in function in aggregates to extract the year and the month from a date.
Regards,
Daniel
Thank You @Daniël Kuhlmann I got it..but also i want to sort like Current month record should appear first then followed by december,Jan,Feb....so on...
But I have Month column with the data Type as Text...so How do I do that...
I think this is the real problem, your entity should have the year and month numeric, then it would be easy to derive the month number. Maybe this post will help you:https://www.outsystems.com/forums/discussion/68981/get-month-integer-by-text-month-name/
But honestly, for a good solution to your question, make sure in your entity you have the year and month number, or a date.
Hello Akshata,
Hope you are doing well.
You can refer below thread for your reference.
https://www.outsystems.com/forums/discussion/40947/sort-by-month-in-aggregate-on-a-date-attribute/
Ajit kurane.
yes it has the same info that I shared.
Hi @Ajit Kurane
Thanks for the reply...but my case is bit different...I have Month column with the data type as Text...so i want to sort it month wise..like Jan,Feb,March so on...and also I want the record having current month should appear first...
ex: Current Month is: November then Records with the month column November should appear first then followed it by Dec,Jan,Feb and so on...
Hello Akshata
I have attached a file , i think it would be helpful for solution .
Happy coding!
This module is not working in my personal environment...its throwing the error Message