Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

General Discussions

Discuss any topics that are not product-specific here.

Generate list of dates

swapsingh2712
8 - Asteroid

Hello All,

 

I'm trying to create an alteryx workflow which will generate values based on the dates mentioned in the existing column.

 

So I've few tests that has a activation and decommission date.

 

Now I've to add a column using alteryx which will generate the current dates.

 

so here are the conditions on which the values should be generated

 

Condition 1: If test 1 activation date 10/1/2019 and no decommission date. It should generate 6 months previous and future  months like this (based on the current month like 11/24/2021)

5/1/2021
6/1/2021
7/1/2021
8/1/2021
9/1/2021
10/1/2021
11/1/2021
12/1/2021
1/1/2022
2/1/2022
3/1/2022
4/1/2022

 

 


Condition 2: 
If the activation date is 9/1/2021 and no decommission date. the new column should generate 6 months forward dates based on the current month and activation date 

 

9/1/2021
10/1/2021
11/1/2021
12/1/2021
1/1/2022
2/1/2022
3/1/2022
4/1/2022

 

Condition 3: If the activation date is 10/1/2019 and decommission date is 12/1/2021. The dates should be like this

 

5/1/2021
6/1/2021
7/1/2021
8/1/2021
9/1/2021
10/1/2021
11/1/2021
12/1/2021

It should be 6 months previous to the activation date month and end till the decommission date.

 

All these data will be generated based on months and year. I've attached an excel sheet with expected input and output.

 

Also in the output I've highlighted the section that should not show up in the output.

 

Dataset is also available in the attachment

 

Please let me know if we can achieve this using alteryx.

 

the current month will be generated using alteryx.

 

Regards,

Swapsingh2712

 

 

 

3 REPLIES 3
TheOC
15 - Aurora
15 - Aurora

hey @swapsingh2712 

I would suggest posting this over on the designer discussions forum - which is more focused on designer questions, than the 'general' section.
You can find this here:
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/bd-p/designer-discussions

However, to give some assistance - you will need to use the generate rows tool to generate dates:

https://help.alteryx.com/20213/designer/generate-rows-tool

 

This tool allows you to generate a row for each iteration of a condition. In this case, you would want to generate 6 months of data.

 

I believe the example workflow of generate rows, shows an example of similar.


Hope this helps,
TheOC


Bulien
swapsingh2712
8 - Asteroid

Hey @TheOC ,

 

Thank you for your response, Actually I tried creating using the generate rows tool, but it's not working.

 

Please find the workflow in the attachment.

 

somehow I'm not able to put the logic in alteryx. Hence need a help

 

Regards,

Swapnil

 

mathieuf
Alteryx
Alteryx

Hi @swapsingh2712,

 

Here is an example attached.

Mind the type of data you are working with, I guess it all should be dates.

 

Overall thinking: calculate the min and max dates for each conditions and then apply with Generate Rows.

 

Hope this help.

Labels