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

Generate Rows issue..

Rawan
7 - Meteor

Hello all,

 

I did use Generate Rows before and it worked just fine, this time I am having this issue and not sure how to fix it.. here is my example:

 

Alteryx Designer x64 - GNAV.yxmd__2018-05-15_11-54-33.png 

 

I want to have another Row for 2017:06:22 17:00:21.. Not sure why it is not doing it.. this is how my Generate Rows tool properties look like:

 

Alteryx Designer x64 - GNAV.yxmd__2018-05-15_12-00-01.png

 

I appreciate your thoughts on this..

 

Rawan

 

 

 

5 REPLIES 5
MarqueeCrew
20 - Arcturus
20 - Arcturus

@Rawan,

 

This might work for you (it will work, but is it what you want?) and is worth a try:

 

Change your initialization to find the hour that the min starts:

datetimetrim([min],"Hours")

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Rawan
7 - Meteor

@MarqueeCrew

 

Thanks so much for suggesting this, it does work for our reporting purposes. I really appreciate your help..

 

Rawan

ivoller
12 - Quasar

@MarqueeCrew's answer is excellent as always. I'm not sure what happens if your Min and Max times extend into different days so another possible approach is an condition expression like

 

DateTimeDiff([Hourly],[Max],"hours") < 1

 

Iain

Rawan
7 - Meteor

@ivoller

 

Thanks for responding to my question.. in my data, there will not be a case where Min and Max dates extend into different days, I actually look at Min and Max for each user on a daily basis. but with that said, I wanted to try your approach to understand how it will be different, and interestingly, the workflow generated an extra row for each case and I am not sure why, here is how it looks with @MarqueeCrew 's approach:

 

Alteryx Designer x64 - GNAV.yxmd__2018-05-15_13-08-22.png

 

and here how it looks using your approach:

 

Alteryx Designer x64 - GNAV.yxmd__2018-05-15_13-09-40.png

 

it added an extra row for the hour 18:00:00. do you know why would it do this?

 

Thanks

Rawan

ivoller
12 - Quasar

@Rawan

 

Sorry for the delay in getting back to you - real life intruded

 

I had set my condition expression to force the extra row because I thought that was what was required.

 

See attached for a simpler example based on your data.

 

In the first GenerateRows tool I am using the original logic. I have added additional variables so that you can see the results of the generation process (initialize variable, write row, loop to set next value of variable, if condition is True repeat from write row). You will see in the example that after the second row is written the next value is such that the condition will return False so the third row is not written.

 

In the second GenerateRows tool you'll see that after the second row is written the next value is such that the condition will return True so therefor the third row will be written.

 

Cheers,

Iain

 

 

Labels