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!

Alteryx Designer Desktop Discussions

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

Addition of Rows on the basis of time slots

vidhuvaibhav
5 - Atom

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!

5 REPLIES 5
Thableaus
17 - Castor
17 - Castor

Hi @vidhuvaibhav 

 

Here's what I thought.

 

Slot.PNG

 

 

Cheers,

danilang
19 - Altair
19 - Altair

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

vidhuvaibhav
5 - Atom
@danilang,
Thanks for the solution. It really helped.!!
danilang
19 - Altair
19 - Altair

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

Thableaus
17 - Castor
17 - Castor

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