Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!

Forum

Trouvez des réponses, posez des questions, et partagez votre expertise d’Alteryx.
TIPS de la semaine

Chaque semaine, découvrez de nouvelles astuces et bonnes pratiques pour devenir un expert !

Voir l'index

Ho to transform a repetitive occurence of my workflow into an iterative macro

RomainDv
Météoroïde

Dear Community,

While process a dataset presenting a hierarchy, into a tab where each "child" is characterized by its level in the hierarchy, I had to repplicate, in my workflow, the sam-sub-workflow 8 times (as there are 8 levels in my hierarchy).

This is not very convenient, and would like to be able to transform this repetition of the same workflow, into an iterative macro (I understand this is the tool I need), that would iterate up untill all the children in the hierarchy, got their level # set (which may not be 8, but rany other random number in other dataset).

Can anyone help me out regarding this ? Much appreciated.

Attached - the workflow & the dataset; the repetitive portions are located into the tool Containers (7 times the exact same). Thanks

 

Romain

 

 

2 RÉPONSES 2
VincentL
Météore

Bonjour Romain,

As-tu toujours besoin d'aide pour créer une macro itérative ?

Si oui , peux-tu me fournir un exemple de ton fichier en entrée ? Je vais jeter un coup d'oeil.

 

voici en PJ un exemple de macro itérative 'simple' que j'utilise dans mes flux qui lit une hiérarchie de taille inconnue

Il suffit après ça de travailler sur la sortie full et constituer ton traitement final

 

(Les exemples sont contenus dans l'input itératif)

VincentL
Météore

En faisant un clic droit sur les éléments contenus dans le control container (celui du Niveau 2, car le Niveau 1 est différent), et cliquant sur "Convert To Macro", tu auras automatiquement ce que tu recherches (en PJ).

Il suffit ensuite de déclarer ta macro en tant que macro itérative et paramétrer pour la lancer 100 fois - sans générer d'erreur (output left over records)

Tu obtiendras ton résultat attendu...

(pour le niveau 1 , il faut laisser le petit traitement sans l'intégrer à la macro si tu ne veux pas te compliquer la vie)

Étiquettes