Specific Strings related to the selected quarter

Hi,

I would like to create 2 different strings out of a specific quarter.
By example if I take the current quarter (which is the 3rd quarter of 2020) I want to write in a Type Into Activity “Q3-2020”, but in another Type Activity I want to write “Extract Q3 2020”.

Thank you for your help, it would really help me out :slight_smile:

Have a nice day

Tommy

You can get the quarter number like this:
Dim quarter As Integer = (someDate.Month - 1) \ 3 + 1

2 Likes

Hi bcorrea,

Can you be a little bit more specific, I do not understand, I am sorry

Thank you

Tommy

In your type into activity, write as follow:

String.Format("Q{0}-{1}", ((Date.Today.Month - 1) \ 3 + 1), Date.Today.Year)
and the other one:
String.Format("Extract Q{0}-{1}", ((Date.Today.Month - 1) \ 3 + 1), Date.Today.Year)
1 Like

Wow,

Thank you really much bcorrea it works now :slight_smile:
If I want to add a AddMonths formula or something like that (to get next quarter in 3 months) where do I put it?

Tommy

I would create a integer variable called MyQuarter and assign like this:
varThisQuarter = (Date.Today.Month - 1) \ 3 + 1
varNextQuarter = varThisQuarter + 1
or
varNextMonthQuarter = ((Date.Today.AddMonths(1).Month) - 1) \ 3 + 1

2 Likes

Wow thank you really much Bruno :slight_smile:
Have a nice day

1 Like

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