Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Parse yxmd as xml to see which tools are used in a module, and how often

jt_edin
8 - Asteroid

I have a slightly unusual request - I want to input (not open) a yxmd module as a text file and parse the xml to see which tools I use, and how many times I use them. So I could input a module, and would get something like this:

 

Join - 14

Summarise - 4

Browse - 3

Input - 1

Output - 1

 

When I change .yxmd -> .txt and look at the contents, I can see a structure a bit like this:

 

<Properties>
  <Configuration>
    <SummarizeFields>

 

Which tool should I use to recognise the above pattern, and save each entry in the line after <Configuration> to a new record? I could then summarize that to find out how often I use each tool. I might need a simple lookup between the xml title <SummarizeFields> and the normal titl (Summarize) but that should be fairly easy to accomplish. However my text file parsing skills aren't good enough to automate the required step. Any help would be much appreciated! Thanks

2 REPLIES 2
BenMoss
ACE Emeritus
ACE Emeritus

Hey,

 

It may be worth checking out one of the sample macro examples that exists within Alteryx.

 

Go to Help > Sample Workflows > Use Scripting and automation tools > build a macro > Identify Tools and Macros used in a workflow

 

This will give you a sample yxdb which runs through a sample macro which gives the level of detail you have described in your post.

 

image2.PNG 

 

You could simply change the directory input with your input file and run the workflow and you should get your desired result.

 

Ben

H193313
6 - Meteoroid

Hi, 

do you know, If there is a way to get even list of tools in same order how they go in a flow?

Thanks.

Labels