Start Free Trial

Alteryx Designer Desktop Discussions

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

How to impletement the below sql logic in Alteryx (use either Generate rows or iterative m

Celeya
6 - Meteoroid

" WHILE "
" (SELECT COUNT([Composite role]) FROM #composite_roles WHERE [Iteration] = @count) > 0 "
" BEGIN "
" INSERT INTO #composite_roles "
" SELECT "
" [Base].[Client] "
" ,AGR_AGRS.AGR_NAME AS [Composite role] "
" ,ISNULL(AGR_AGRS.AGR_NAME + ';', '') + [Base].[Role tree] AS [Role tree] "
" ,[Base].[Role] "
" ,@count + 1 AS [Iteration] "
" FROM "
" #composite_roles AS [Base] "
" INNER JOIN [app_sap].AGR_AGRS "
" ON AGR_AGRS.MANDT = [Base].[Client] "
" AND AGR_AGRS.CHILD_AGR = [Base].[Composite role] "
" WHERE "
" [Base].[Iteration] = @count; "
" "
" SET @count = @count + 1; "
" END; "

2 REPLIES 2
MinhLO
7 - Meteor

@Celeya 

Iterative macros => you can leverage this tutorial to help you :

Alteryx Iterative Macros - YouTube

 

Then your stopping condition can be a max number of iterations.


The other thing i discovered recently and could be of interest for you is the Make Group tool. Maybe try dedicating a few minutes to see if it suits your needs => could make you win some time .

MinhLO_0-1761303714125.png

 

dreldrel
9 - Comet

Could you explain the main purpose of this query? I can see you also join another table apart from the interative process

Labels
Top Solution Authors