9 Replies Latest reply: Sep 6, 2018 4:07 AM by Marcus Sommer

# Creating day Numbers

Hi All,

I want to assign numbers to each quarter..Like for Q1, 1 to 100 and for 2nd quarter again it should start from 1 to 91...

same for Q3 and Q4.

Can someone suggest me.

Muni.

• ###### Re: Creating day Numbers

Hi Muni,

Can you please provide the full requirement?

Why is Q1 starting from 1-100 but Q2 is 1-91?

What about Q3 and Q4? is it 1-100 or 1-91?

• ###### Re: Creating day Numbers

Try it with: daynumberofquarter().

- Marcus

• ###### Re: Creating day Numbers

HI Marcus,

I want to achieve the below .

`date       expected_value2017-01-01        1         # because it it the first day in Q12017-01-02        2         # because it is the second day in Q12017-02-01        32        # because it is the 32th day in Q12017-04-01        1         # because it is the first day in Q2`

Thanks,

Muni.

• ###### Re: Creating day Numbers

Did you try: daynumberofquarter(date) ?

- Marcus

• ###### Re: Creating day Numbers

Thanks Marcus,

It is working fine.

• ###### Re: Creating day Numbers

Hi Marcus,

How can i get same DayofQuarternumber of previous quarter.

Example: 2018Q3 ,9/5/2018, 67Day, value

2018Q2, 6/5/2018, 67Day, value (need to get this dynamically)

Thanks,

Muni.

• ###### Re: Creating day Numbers

I think it's not possible - then months have just a different number of days and therefore the quarter-number couldn't return the same calendar-day in another quarters. I think you need a different approach for it - maybe with addmonths() like:

- Marcus

• ###### Re: Creating day Numbers

Hi Marcus,

I tried this "addmonths(date, -3)" but it will not give the same DaynumberofQuarter.

Muni.

• ###### Re: Creating day Numbers

My suggestion with addmonths() wasn't aimed to get the same quarter-number (like above mentioned I think it's not possible) else to return the same calendar-date (day-number) within the months.

I don't know what your aim is with the quarter-number but a comparing of any measure against them or a monthly calendar-day will always have some blurring. An alternatively (which also not mandatory give you the same calendar-day back) might be to count working-days within your periods (excluding weekends or any kind of holidays).

If everything of it is not really satisfying for you you could consider to use another calendar like 4-5-4 Master Calendar whereby I'm not sure that any of the alternative calendars might fit to your requirements and/or have other disadvantages.

- Marcus