Alteryx Designer Desktop Discussions

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

Equivalent of looping?

fleenorg
5 - Atom

I have looked at a couple forum posts on here about equivalent examples to a nested for loop/conditional loop, but I can't get the exact answer I am looking for.

 

I am trying to compare a specific datetime from an individual row in a table to a datetime value in all the other rows in the table with the same unique key value. I want to do this for every row in the table, so I would be looping through every row in the table ONE time for EVERY row, in other words a nested/double loop. My question is would this accomplished using one of the macros? Or could I get along without those tools? 

 

I am new to alteryx, so thank you in advance :)

4 REPLIES 4
Thableaus
17 - Castor
17 - Castor

Hey @fleenorg 

 

Check this post - CS Macro Dev: Batch Macros – when to use the Group By, the Control Parameter or both!

 

I think the Batch Macro could fit your scenario. It seems you also need to join the parameter values inside the loop, so you might need to use the Group By option.

 

Let us know if you need further assistance.


Cheers,

danilang
19 - Altair
19 - Altair

hi @fleenorg 

 

The answers to "My question is would this accomplished using one of the macros? Or could I get along without those tools?" Are Yes and Maybe.  What type of macro to use in the 1st case and how to determine if you can do it without a macro, depends on the data that you're using and exactly what you want to accomplish.  If you join the two tables on unique key, you can then compare the timestamps from the first table to all the timestamps in the second.  This may be all that's required to solve your problem, but we need to know more details about what you need to do.

 

Can you provide some sample input data, details about the comparison process and the corresponding output?  

 

Dan

fleenorg
5 - Atom

Dan,

 

Attached is an example of what I am working with. 

 

Data like this would be inputted. To be more specific about my problem, I want to look at the transactions for each account and see if any account has transactions being made on a monthly basis. The amount doesn't need to the exact but it should be similar. 

 

The output would be a new field that is just true or false if that transactions happens at least 1x per month. 

 

Let me know if you have any other clarifying questions.

 

Thanks,

Geoff

Tanai_Goncalves
8 - Asteroid

Hello,

 

not sure about dataset size, but for a small dataset, you could split your workflow grouping by the date you want find, and then join together the grouping results and real data using the “Append Field” tool. Later is just filtering dates.

Labels