Hi everyone!
I'm trying to create a macro in Alteryx Designer that dynamically uses Transpose, meaning it changes Key Fields and Data Fields at runtime based on the fields in the input dataset.
What I already have:
An Input Data that feeds a Field Info.
A Filter that separates fields that start with "Price" (for DataFields) and others (for KeyFields).
A Summarize that concatenates the column names with the <Field field="..." /> structure, generating a [Concat_Name] field.
Next, I use a Formula Tool to generate the full XML in the [Full_XML] field, in the following format (Appendix xml_tool).
What I tried:
- Insert a Transpose Tool right after the formula (without manually marking anything).
- Connect an Action Tool to it, configured with:
- Update Outer XML
- Selected XML: <Transpose>
- Field to update: [Full_XML]
Transpose (12): At least one Field must be selected
Action (16): Parse Error at char(28): Unknown variable "#1"
Apparently, the XML is not being injected correctly by the Action Tool, and Transpose complains about not having marked fields.
What's the correct way to configure the Action Tool to replace Transpose XML based on the [Full_XML] field?
Does this approach actually work with Transpose, or do I need a different strategy (perhaps with nested macros, Batch, or an alternative)?