Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Generate values for missing months

BalaBhaskar
6 - Meteoroid

my input :

 

Item     Price         FromDate              ToDate

A               10           2023-05-01         2023-06-30

A               15           2023-07-01         2023-09-03

A               14           2023-09-04         2023-11-02

A               12           2023-11-03         2024-01-31

A               17           2024-02-01         9999-12-31 (Current price as of today)

 

 

Expected output: (If i run it today)

 

Item         Price              FromDate               ToDate

A                   10               2023-05-01          2023-05-31

A                   10               2023-06-01          2023-06-30

A                   15               2023-07-01          2023-07-31

A                   15               2023-08-01          2023-08-31

A                   14               2023-09-01          2023-09-30

A                   14               2023-10-01          2023-10-31

A                   12               2023-11-01          2023-11-30

A                   12               2023-12-01          2023-12-31

A                   12               2024-01-01          2024-01-31

A                   17               2024-02-01          2024-02-29

A                   17               2024-03-01          2024-03-31

A                   17               2024-04-01          2024-04-30

A                   17               2024-05-01          2024-05-31

 

 

I used generate rows tool but getting duplicates, please help me

 

6 REPLIES 6
AGilbert
11 - Bolide

To avoid creating duplicates I reset each start date to the first of the month and ran the generate rows tool on only the first record.

 

Screenshot 2024-05-23 104215.png

alexnajm
18 - Pollux
18 - Pollux
Raj
16 - Nebula

@BalaBhaskar 
please find the workflow attached kept it simple.
hope this helps.

BalaBhaskar
6 - Meteoroid

Its little bit different and used the same logic but not getting forward months data (Ex: 2024-03-01,2024-04-01 & 2024-05-01).

And tried different logic and getting duplicates as the from date & to date falls in the middle of the month

Raj
16 - Nebula

@BalaBhaskar have you tried my workflow?

BalaBhaskar
6 - Meteoroid

Thanks very much @Raj , It is working fine for me

Labels
Top Solution Authors