Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Generating dates with Q's

Wojtek_Dz
8 - Asteroid

Hello, 

 

I'm looking for better (more elegant) solution than mine ‌‌


I want to create the dates between starting and ending date. Next I need to add quarters starting from start date. (e.g. 01.12.2012 - 28.02.2013 - Q1 etc.)

 

1.png

 

 

 

 

 

 

 

 

 

2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4.png

 

 

 

 

 

 

 

 

 

 

 

 

 

5.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6.png

 

 

 

 

 

 

 

 

7 REPLIES 7
gawa
15 - Aurora
15 - Aurora

hi @Wojtek_Dz 
>Next I need to add quarters starting from start date. (e.g. 01.12.2012 - 28.02.2013 - Q1 etc.)

Can you clarify what does it mean? For example, why the following records fall in "2013 Q1", while 2012-12-01 & 02 are within 2012-Q4.

image.png

Aryasuta_Panda
7 - Meteor

Hi , the field "Quarters" is calculated from the field "Date_Q_2". As per the condition you have mention in the calculation, the Quarters should be calculated from the field Date_Q. Else you can update the calculation for Date_Q_2, by replacing field DateGenerate with LastDateGenerate.

 

Thanks

Wojtek_Dz
8 - Asteroid

Hi @gawa 

 

in the normal case Q1 is 01-03.2013. But in my case the FY is starting at 01.12.2012 (dd.MM.yyyy). (one month earlier then in normal case). 

Wojtek_Dz
8 - Asteroid

.

Wojtek_Dz
8 - Asteroid

Hi @Aryasuta_PandaIn normal case yes, but my FY is starting from 01.12.2013, and from this date I need to create the Quarters (01.12.2012-28.02.2013 - Q1 etc.

gawa
15 - Aurora
15 - Aurora

hi @Wojtek_Dz  I got it. Then, you can go with the following Formula expression. I added this Formula tool as a new container in the attached WF.

 

//Year
ToString(DateTImeYear([StartDate])+1+
DateTimeDiff([DateGenerate],[StartDate],"year"))

+" "+

//Quarter Number
"Q"+ToString(Floor(Mod(DateTimeDiff([DateGenerate],[StartDate],"month"),12)/3)+1)

 

  image.png

Wojtek_Dz
8 - Asteroid

nice @gawa  thanks !

Labels