We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Dynamically Update RecordID XML

KBKing22
5 - Atom

Hello all,

I am working on an Alteryx flow that I would like to function very similarly to Chaos Reigns dynamic formula tool but instead use the RecordID tool and the new groupby functionality. (Tile tool would be fine too, I think).

I have been using the Dynamic Formula tool as a direct example but am having a hard time getting the output correct. Ideally the tool would output the exact same number of columns with the "GroupBy column being out with the new sequence of numbers.

The end goal is that this snippet of a flow will be added into a larger flow that is very dynamic in nature and performs tasks on the data based on rules. (In other words I dont necessarily know the names of column(s) to group by in advance nor if I will even have ANY that need to go through this flow).

Any help is appreciated.

 

Sample Data is in a text input tool which also contains expected outputs. 

 

*EDIT* Updated the Attachments.

4 REPLIES 4
KGT
13 - Pulsar

Not sure exactly what you are after out of the macro. I think it's a recordID for each member of either Data Key or Stack Column. If it is a grouped recordID that you are after, then your macro could just use the way before the "Grouped RecordID" update.

 

Sort, then Multi-Row Formula. Your macro can update the field for both the sort and the Multi-row Group.

 

By the way, you can go to "Options > Export Workflow" to create a yxzp (Alteryx Zipped Package) of your workflow with macro included etc. It normally wouldn't affect me, but in this case, I'm opening your workflow on an older version, and am unsure if I've got it all.

KBKing22
5 - Atom

Hi KGT, thanks for taking a look. The reason I think I need the batch macro is because I wont know how many columns need to be grouped. So ideally the workflow that this is nested within would generate a list of column names that need to be included in individual "Group by" statements 1 by 1. Like you said though, I am not entirely convinced it has to be the Record ID tool, but it seems to be a one stop shop for the functionality I am after. I have done as you asked and created a package. 

KGT
13 - Pulsar

OK, I agree that if you're not sure how many columns need to be grouped and different things need to happen to different records then a Batch Macro will most likely be best. Something to be careful of is that your fields coming out of the Batch Macro will not be consistent as they will be labelled differently for different records.

 

To calarify, the expected Data Key and expected Stack Column fields are identifiers for the grouping, not line numbers inside each grouping. The grouped recordID would have results for [Expected Data Key] that are 1,2,1,1,2,1,1,2,1,2.... as it will restart the count at each new group. Are you actually after a summarise and then recordID?

 

I couldn't package it without downscaling your macro to my version and hence removing the new RecordID, so I've just posted the yxmd. It shows the different interpretations and matches the "expected fields" but I haven't gone as far as the macro with it...

KBKing22
5 - Atom

Your input helped me get 2 working macros. I think you helped me in 2 major ways. 1) you made me realize I was dealing with 2 separate but very similar issues. 2) Using the formula tool as a sort of variable really makes this work. This week I will toss some real data at them and see how it goes, but I am optimistic! Ill upload the latest and mark as solved if it does the trick.

Labels
Top Solution Authors