Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Is an iterative Macro needed?

RAM-ler
6 - Meteoroid

Hello together,

I am still a beginner in Alteryx and I would appreciate your help:

In the file below I have written the Child ID... and I want a workflow that gets me the respectiv Parent ID, which is mostly build as the Child ID but without the last segment (see attached file). How can I do that dynamically? Do you have a good idea for that?  

5 REPLIES 5
Qiu
21 - Polaris
21 - Polaris

@RAM-ler 
If you want to generate a Parent-child hierarchy we can use this macro.

https://community.alteryx.com/t5/Community-Gallery/Hierarchy-Generation-Macro/ta-p/880709

0721-RAM-ler.png

KGT
13 - Pulsar

Are you just trying to knock the last segment off?

Trimright([ChildID],".") and then find the last Full Stop and trim that with Left([ChildID],Length([ChildID])-Findstring(ReverseString([ChildID]),"."))

RAM-ler
6 - Meteoroid

@Qiu Thats wonderfull, that really worked out!!! Thanks a lot!
Best regards, 

Baraa

RAM-ler
6 - Meteoroid

@KGT yes exactly, thats what I am trying to do... and I tried that your suggestion a lot but it did not work 

KGT
13 - Pulsar

In that screenshot, the second formula needs to act on the result of the first formula. I probably didn't show that well in text.

Labels
Top Solution Authors