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.
SOLVED

Dynamic Summarize

shlokmittal
6 - Meteoroid

I have 2 inputs. One is a typical Data file with dimension and measure columns and the other one is configuration file. This configuration file has a column which specifies a column name from Input 1 for which a Group by summarized output is expected. The configuration file will have multiple rows which I will loop through and generate Summarized Group by Result for the column.

I want to be able to dynamically select the column from Input 1 in Summarize tool which is specified in Input 2.

Is there a way I can achieve this?

7 REPLIES 7
jdunkerley79
ACE Emeritus
ACE Emeritus

Could you post some sample data to show us what input and output you want?

 

Dynamic summarization is possible but can be a little fiddly. 

shlokmittal
6 - Meteoroid

Data Table

 

NameBrandChannelSales
JerryAppleAir10
AdamAppleAir20
EvaSamsungCargo

50

 

Configuration Table

ColumnNameDataType
NameString
BrandString
  

 

So the output is, loop through configuration Table

1st iteration. read the value "Name", apply Group by on Data Table for column Name and get the results (Jerry, Adam, Eva).

2nd Iteration: read the value "Brand", and get the Group by output (Apple, Samsung).

 

I will think about iterations later on (via iterative Macro), but I am not able to dynamically select column in Summarize tool, based on a table value.

Hope it is clear.

jdunkerley79
ACE Emeritus
ACE Emeritus

I would do it by transposing the key fields and then joining to the groupings.

 

As a quick demo put together a sample allowing 2 level dynamic groupings:

2017-06-13_11-21-21.jpg

MarqueeCrew
20 - Arcturus
20 - Arcturus
How about transposing input 1 then running a unique on name and value. Now you can join on name to input 2 to limit to the desired fields.

Last step would be to crosstab the data for output.

It's a thought.

Cheers,
Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Joe_Mako
12 - Quasar

How about a batch macro to edit the XML of a Summarize tool:

 

Dynamic Summarize.png

 

Also attached is a workflow with some example uses. Grouping does need to be specified, and you will need to know the Action code. To get the desired Action code, we can view the XML of a configured Summarized tool. To enable this option in the Configuration, check the box for: Options -> User Setting -> Edit User Settings -> Advanced -> Display XML in Properties Window

shlokmittal
6 - Meteoroid

Thanks you all for the Solutions.

I figured it out myself using Dynamic Rename Tool. So from Input 2 I rename my column using the option Take Field names from right Input Rows and then specify the Old and New column Names. Worked perfect for me.

 

image.png

davidweisser
5 - Atom

Thank you @Joe_Mako. This is a really robust solution and exactly what I have been looking for.

Labels