Alteryx Designer Desktop Discussions

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

Generate rows dynamically for month

Shank
8 - Asteroid

HI all,

 

I have a set of data where i need to generate a row if no data available for  that particular month. below is my input and output required.

 

i have a set of data which has to generate the row dynamically for next 12 month and where ever we dont have data just need to show count as 0.

 

in below case we have Calendar day whcih reads as August 2018 (8.2018).

 

next month it will change to 09.2018 to 08.2019 so i need to set it dynamcially to generate the row can anyone help on this?

 

 

Input

 

CodeNameLocCalendar DayCount
1A4278.2018160 KG
1A4279.2018100 KG
1A42710.2018200 KG
1A42712.2018100 KG
1A4271.2019100 KG
1A4272.2019200 KG
2B4278.2018100 KG
2B4279.2018200 KG
2B42710.201860 KG
2B42711.2018160 KG
2B42712.2018480 KG
2B4271.201920 KG
2B4272.201920 KG
2B4273.201920 KG
2B4274.201920 KG
2B4275.201920 KG
2B4276.201920 KG
2B4277.201920 KG
3C42711.201823 KG
3C42712.2018115 KG
3C4271.2019113 KG
3C4272.2019112 KG
3C4273.2019121 KG

 

 

 

Output

 

CodeNameLocCalendar DayCout
1A4278.2018160 KG
1A4279.2018100 KG
1A42710.2018200 KG
1A42711.20180 KG
1A42712.2018100 KG
1A4271.2019100 KG
1A4272.2019200 KG
1A4273.20190 KG
1A4274.20190 KG
1A4275.20190 KG
1A4276.20190 KG
1A4277.20190 KG
2B4278.201820 KG
2B4279.2018200 KG
2B42710.201860 KG
2B42711.2018160 KG
2B42712.2018480 KG
2B4271.201920 KG
2B4272.201920 KG
2B4273.201920 KG
2B4274.201920 KG
2B4275.201920 KG
2B4276.201920 KG
2B4277.201920 KG
3C4278.20180 KG
3C4279.20180 KG
3C42710.20180 KG
3C42711.201823 KG
3C42712.2018115 KG
3C4271.2019113 KG
3C4272.2019112 KG
3C4273.2019121 KG
3C4274.20190 KG
3C4275.20190 KG
3C4276.20190 KG
3C4277.20190 KG

 

 

 

1 REPLY 1
BenMoss
ACE Emeritus
ACE Emeritus

There's a quite simple solution to this and it uses the 'generate rows' tool.

 

Here we can use the datetimetoday() function to acknowledge the current month and then use the generate rows tool to get the 12 months that should be in our data stream for each group.

 

You can then do an append and a join to bring calculate what months are missing.

 

Then a union to bring your data together into the output.

 

See attached solution.

 

Image.png

 

Ben

Labels