314
Views
4
Comments
Solved
Grouping data by Month
Service Studio Version
11.53.26 (Build 61639)

Hello,

I am new to outsystems. I want to group my data aggregate by Month. What I did so far is to create a new attribute with the value of Month(ProjectSavings.Month) to assign the month integer value to each data and then grouping the data by the month integer: 


However, I would like for it to be group by the name of the month (January/Feburary/March etc...) instead of it being group by integer right now. What can I do to achieve this? Thank you!

2022-05-02 13-50-49
Paulo Ritto
Solution

Hi @Low Ding En ,
You can do it by using the FormatDateTime built-in function. However you cannot use formatdateTime inside an aggregate (as far as i remember, might have changed).
So what i recomend you doing is leaving it like you have, but then on your widget on screen where you will be displaying the value, in the expression wherever you want to show the month name, you put the expression value like this:


FormatDateTime(NewDate(2000,MonthByNumber,1),"MMMM")

PS: The values on the new date for year and day doesn't matter, you just want a date with your month so that you can then pass that date to the formatDateTime function, and passing "MMMM", which will return the full month name of that date!

Let me know if this helped!
Regards,
Paulo

UserImage.jpg
Low Nico

Hello Paulo,

Thank you so much for your help! This was what I was looking for!

2023-10-21 19-42-11
Tousif Khan
Champion

Hello
You can refer to this post hope this might help

https://www.outsystems.com/forums/discussion/48121/how-to-convert-monthinterger-type-to-stringname-of-month/

Best Regards
Tousif Khan

UserImage.jpg
Low Nico

Hello,

Thank you for your suggestion, it was helpful !

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.