Quarter (Q1) need to place in subject line of email dynamically

Hi Community,

i had an issue with the email subject line need to update Q1,Q2 things according to the current month calculation.

Ex. if Month jan,feb,march - Q1
April,May,June - Q2.

can you please help on the flow design in assign activity. so that i can update in the email body.

Thanks and regards.

@chaitanyaKumar

Use this logic

strQuarter = If(intMonth <= 3, "Q1", If(intMonth <= 6, "Q2", If(intMonth <= 9, "Q3", "Q4")))

Hello @chaitanyaKumar,

You can create a new dictionary variable of type string, string and assign these values to it.

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 you can simply make use of this below expression to find out Quarter.

dict(MonthName(today.month,true))

Regards,
Bharat

Hi!

You can use the β€œnumber” of the month and the knowledge that a quarter is divided into 3 months :slight_smile:

β€œQ”+(((Now.Month - 1) \ 3) + 1).ToString

i am getting this error ashok

@chaitanyaKumar,

Make sure strQuarter is of type String and intMonth is of Int32 datatype

yeah it worked, and have a smal doubt.

If(intMonth <= 3, β€œQ1”, If(intMonth <= 6, β€œQ2”, If(intMonth <= 9, β€œQ3”, β€œQ4”)))

as per this logic <=9 is not less than 9 then it default take Q4 or need to write logic on that.

@chaitanyaKumar,

It’s already covered. Q4 will be returned only when these conditions will fail - intMonth <= 3, β€œQ1”, If(intMonth <= 6, β€œQ2”, If(intMonth <= 9, β€œQ3”

So need of additional logic. Cheers!

thanks ashok for simplifying things and taking your time. it worked.

1 Like

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