Alteryx Designer Desktop Discussions

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

While Loop in Alteryx (SQL)

tjamal1
8 - Asteroid

I am trying to replicate a SP which have a while loop that checks specific condition 

 

While CONVERT(date, GETDATE()) >= end_date and @@end_date <= Cast(Cast(Max_Txn_date as varchar(10)) as date

Begin
Select @@start_date as 'start_dt
,end_date as 'end_dt'....

...

..

Is there anyway i can write or implement that same loop logic in Alteryx Designer 

3 REPLIES 3
GiuseppeC
Alteryx
Alteryx

Hi @tjamal1

 

have you tried with Iterative Macros? https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/CS-Macro-Dev-Iterative-Macros/ta-p/...

 

It'll allow you to iterate through the macro logic until a condition is met.

 

Hope this helps,

Giuseppe

tjamal1
8 - Asteroid

Thanks for the reply , can i use it with INDB tools ? 

GiuseppeC
Alteryx
Alteryx

@tjamal1,

 

editing the original post with the actual solution, as shared by @JoeS here.

 

"Due to the nature of In-DB tools creating a script and processing it database side, it's not possible to then create batch or iterative macros whereby the data has an impact on the flow itself (AKA how many batches, potentially depending on control parameters changing the configuration each time)."

 

If you have a stored procedure already written, you can run it both from the standard Input Tool of from the Connect In-DB tool.

 

Best,

Giuseppe

Labels