Alteryx Designer Desktop Discussions

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

Adding Months to the data based on their start and end dates

Destinitruth
6 - Meteoroid

Hello, 

 

I am trying to insert months into my volume data set based on the start and last dates (J1 and JL).

 

I was able to add months to the years listed, but it listed out all 12 months for each year. Some years like 2026 only have two months. 

 

Is there a way I can add a column that will insert the correct months based on the J1 and JL dates for a specific program? 

 

for example 

11/1/2026 - 1/1/2030   Program A   volume #    Month 11 2026

11/1/2026 - 1/1/2030   Program A  volume #    Month 12 2026 

11/1/2026 - 1/1/2030   Program A  volume #    Month 1 2027

 

I am trying to add monthly volume based on their start and end dates. 

2 REPLIES 2
OTrieger
12 - Quasar

@Destinitruth 
Yes, it is possible,

What you will need to do is first to convert the dates to Alteryx Date type and then with Formula tool you can get the month, as a number, such as 12 or as December based on your requirement.

ntakeda
12 - Quasar

Hi @Destinitruth.

I will answer this question as it does not seem to have been resolved.

It can be done using the following method:

  1. Set the start and end dates (J1 Date and JL Date) to the first day of each month (this step is unnecessary if the data always starts on the first day).
  2. Add one month to the date range from J1 to JL.
  3. Extract the year and month from the result of step 2.

A sample file is attached for your reference.
I hope this helps solve your problem.

 

d52eaf74-4172-46c7-a918-ca34c37d9de8.png

 

Labels
Top Solution Authors