Hello
Need help for this situation,
Given :
Name | StartDate | End_Date | No. of days |
Cable | 1/31/2023 | 1/31/2023 | 1 |
Sunspot | 2/15/2023 | 2/15/2023 | 1 |
Domino | 3/20/2023 | 3/21/2023 | 2 |
Cannonball | 3/31/2023 | 3/31/2023 | 0.5 |
Feral | 4/3/2023 | 4/4/2023 | 2 |
Rictor | 4/14/2023 | 4/14/2023 | 1 |
Shaterstar | 4/19/2023 | 4/19/2023 | 1 |
Boom | 4/26/2023 | 4/26/2023 | 1 |
John | 5/3/2023 | 5/5/2023 | 3 |
I want the output to be break down into 1 day per row, output should be like this:
Output:
Name | Start_Date | End_Date | No. of days |
Cable | 1/31/2023 | 1/31/2023 | 1 |
Sunspot | 2/15/2023 | 2/15/2023 | 1 |
Domino | 3/20/2023 | 3/20/2023 | 1 |
Domino | 3/21/2023 | 3/21/2023 | 1 |
Cannonball | 3/31/2023 | 3/31/2023 | 1 |
Feral | 4/3/2023 | 4/3/2023 | 1 |
Feral | 4/4/2023 | 4/4/2023 | 1 |
Rictor | 4/14/2023 | 4/14/2023 | 1 |
Shaterstar | 4/19/2023 | 4/19/2023 | 1 |
Boom | 4/26/2023 | 4/26/2023 | 1 |
John | 5/3/2023 | 5/3/2023 | 1 |
John | 5/4/2023 | 5/4/2023 | 1 |
John | 5/5/2023 | 5/5/2023 | 1 |
Thanks in advance for the help, Thank You :)
Hey @Grail030510, here's a workflow which ought to provide what you're looking for. The steps breakdown as follows:
1) Generate extra rows. Using the generate rows tool, we tell Alteryx to make N rows, where N = your No. of days field. Note: We have had to used the Ceil() function here, as for rows like Cannonball, where you have 0.5 days, generate rows wouldn't generate any days here and so ceil force rounds this up to 1 in order to give it at least a single row.
2) Use a formula tool to simply set the [No. of days] value to 1 now.
3) Select drops the temporary RowCount field used when generating additional rows.
Hope this helps - please do ask if you have any questions!
Hi @Grail030510 I came up with an approach using your start and end dates which needed to be converted into YYYY-MM-DD format to generate each day sequentially in the Generate row tools and then I formarted the date back into the orginal format of MM/DD/YYYY and deselected the uncessary fields that I made during the process.
Hey @Grail030510 . I would use a generate rows tool to get you what you want. With a little data prep you can get the result you want. The Generate Rows tool takes some getting used to but you essentially need to create some logic to loop until a condition is met. Please the attached workflow.
User | Count |
---|---|
106 | |
82 | |
70 | |
54 | |
40 |