Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

App allowing users to manipulate the summarize tool

JonM
8 - Asteroid

Hi All,

 

I have recently overcome a challenge, whereby I wanted to give the end user of an analytical app the ability to choose their aggregations, allowing our line of business analysts to ask additional questions of our data, without needing additional input from my team. As there doesn't seem to have been anyone else post about this in the past, I thought to share how I did it. I will be using the Tableau Super Store data to illustrate below.

 

At a high level, I need to take the tree input from the user, convert it to raw XML instructions to insert into the summarise tool of the final workflow, and then return the results.

 

Tree input

Allows a field to be selected and an aggregation type or types. Need to use a macro to develop the tree structure.

 

Tree Build Macro. Takes a field list, and uses a base input to append aggregations to each field and ultimate outputs the Tree build structure as below1.png

 2.png

 

 

 

Now that the file is built, we can then use it as the data source for the Tree Macro input
3.png

 

 

To take the tree input and send to the Summarise tool we have to edit the Raw XML of the summarise tool. We then need to convert the tree tool output into the XML for the summarise tool, To do this I have used another macro

 

Tree Output To Summarise XML
The tree output the key's select all in the one field with new lines separating, so we first split out to rows on the new line (\n) character. Then using the tree.csv output from the tree build macro we go through and build up the Field and Action instructions to give to the summarise tool which are then concatenated into the one tool to flow into the final macro which holds the actual data workflow.4.png

 

 

Workflow Batch Macro
With all of the XML instruction built, we then need to figure out how we can send a data flow direct into an update tool, this is the part that had me stumped for quite a while, however with a batch macro we can achieve that with a control parameter. As we are only sending one record into the batch macro it will only execute once.

Connect the control parameter to the summarise tool and instruct the action to update the Raw XML then output the data, either into the original app, or a file.5.png

 

 

Lets see how it works! Lets group by customer segment, and sum Profit
6.png

 

7.png

 

8.png

If you would like to get further under the hood of this, I have attached a sample app for you to pull apart

 

 

 

5 REPLIES 5
VizChic
11 - Bolide

Great work Jon.  I think we can roll out beyond Line of Business Analysts, and give this to our Exec Team! Thanks for sharing with the rest of the community

shagun_narula
5 - Atom

Hi Jon,

 

Which version of Alteryx have you used? I'm unable to use the Aggregate App.yxwz. 

Amit_Rastogi
7 - Meteor

Thank you, this is really very helpful. Few changes i am trying here but no luck.
I am creating tree as per user selected field and now i want that this particular tree file is used by its own in the aggregation app.

Suppose user create tree file "A-01-01-2020" then this  file is used in aggregation app automatically... or if user created tree file "A-02-01-2020" then this file is used.. 

jamielaird
14 - Magnetar

This is super helpful, thank you @JonM !

wonka1234
10 - Fireball

@JonM 

 

This is great! however - have you had any issues when using over ten columns? I am getting this on my tenth col:

 

wonka1234_0-1685922111778.png

 

because my tree file looks like this :

 

wonka1234_1-1685922124913.png

 

Labels