community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Addition of Rows on the basis of time slots

Highlighted
Alteryx Partner

Hi,

 

I basically have Start time and End time.

 

I need to add specific time slot 08-10, 10-12, 12-14, 14-16

 

 

Example:

Input

S.No. Start     End

  1. 08:01  10:00
  2. 08:31  10:30
  3. 09:01  11:00
  4. 10:31  12:30
  5. 11:01  13:00
  6. 12:01  14:00
  7. 12:31  14:30

 

Output

S.No Start      End      Slot

  1. 08:01  10:00  08-10
  2. 08:31  10:30  08-10
  3. 08:31  10:30  10-12
  4. 09:01  11:00  08-10
  5. 09:01  11:00  10-12
  6. 10:31  12:30  10-12
  7. 10:31  12:30  12-14
  8. 11:01  13:00  10-12
  9. 11:01  13:00  12-14
  10. 12:01  14:00  12-14
  11. 12:31  14:30  12-14
  12. 12:31  14:30  14-16

 

Note: I only want even slots, Hours starting from odd numbers will be lying in 2 different slots. Secondly, if minutes = 31 then also it will lie in 2 different slots.

 

Please help, thanks in advance!

Alteryx Certified Partner
Alteryx Certified Partner

Hi @vidhuvaibhav 

 

Here's what I thought.

 

Slot.PNG

 

 

Cheers,

Nebula
Nebula

Hi @vidhuvaibhav 

 

Here's my take on it, using the Generate Rows tool to add rows where required

 

solution.png

 

And the results

 

result.png

 

Dan

Alteryx Partner
@danilang,
Thanks for the solution. It really helped.!!
Nebula
Nebula

Hi @vidhuvaibhav. Glad I could help. 

 

I'm not sure if you know this or not, but you can have multiple solutions to a topic.  @Thableaus solution gives you the correct output, even though it's not as pretty as mine:), so you should mark his as a solution as well.

 

Dan

Alteryx Certified Partner
Alteryx Certified Partner

Hey @danilang no worries!

 

We're here to help, even though some of our solutions are not exactly the shortest way to solve that problem.

 

And while I'm trying to provide one, the coolest thing is to be able to learn so much from thinking and getting down to it.

 

Cheers,

Labels