Convert month to quarter

Hi all, can anyone advise how to convert months to quarters as described below.
Jan, Feb, Mar = Q1
Apr, May, Jun = Q2
Jul, Aug, Sep = Q3
Oct, Nov, Dec = Q4

I want to save the file in a folder Q1 etc based on the month the report relates to.
Thank you for your help.
Jan

So how are you getting the month names? is it from the current date as shown below OR from somewhere??

image

Hi, its current month
assign is Month = MonthName(today.month-1,true)

Hi,

How about the following steps?

First, define the following dictionary in advance.

dict = New Dictionary(Of String,String)From{{"Jan","Q1"},{"Feb","Q1"},{"Mar","Q1"},{"Apr","Q2"},{"May","Q2"},{"Jun","Q2"},{"Jul","Q3"},{"Aug","Q3"},{"Sep","Q3"},{"Oct","Q4"},{"Nov","Q4"},{"Dec","Q4"}}

Then

dict(MonthName(today.month-1,true))

returns quarter.

Regards,

4 Likes

I was thinking of this solution but was not sure if its going to work. Will try it this time.
thank you.

3 Likes

Hi, is this part needs to be in assign activity

dict(MonthName(today.month-1,true))
thank you for your clarification.
regards,

its working thank you.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.