Join the Inspire AMA with Joshua Burkhow, March 31-April 4. Ask, share, and connect with the Alteryx community!

Alteryx Designer Desktop Discussions

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

Type of Macro

BRRLL99
11 - Bolide

Hi

I have following dataset

DATASALES
A10
A10
A20
B30
B40
B50

 

I'm using two summarize tools to get overall sum and group by sum, I'm repeating this process for 3 different types , I would like to build macro tool for this.

 

Data columns name will change

BRRLL99_0-1676514223314.png

 

 

7 REPLIES 7
willemb
7 - Meteor

I had a macro for calculating factorials that I very quickly adjusted to do a percentage of total calculation. Have a look at the attached and adjust where necessary. 

 

It's just a normal macro, allows you to select the fields you want to calculate each record's percentage of total, and then appends those percentages to your dataset. 

 

willemb_0-1676533891323.png

 

BRRLL99
11 - Bolide

Hi

I have 2 inputs ,

one input will group by and sum

2nd input will do overall sum

so I have build a combined both by using append tool and used formula tool 

do you have any macro where I can get two inputs

binuacs
21 - Polaris

@BRRLL99 I converted your workflow to the standard macro

binuacs_0-1676535264497.png

 

willemb
7 - Meteor

Made a few changes, but I haven't tested much. You might have to make a few tweaks. 

BRRLL99
11 - Bolide

@willemb@binuacs 

 

As attached in the sample data, I have used two different types of summarize tool,

first one >> sum

2nd one >> count

 

is it possible to make the list where end user can select the type of summarize with the macro

willemb
7 - Meteor

@BRRLL99 

 

See this update to your sample. That's one way of doing either the one or the other. You could also use a list box to select between Count or Sum and use Action tools to update actions in a summarize tool (and fieldnames etc).

 

I think the best thing to do here is to go step by step through the first macro I shared to understand why each tool does what it does to get to a dynamic percent of total. Then make your own adjustments to get it to do what you're after (which I'm not entirely sure I understand). If you get stuck on specifics post those questions here again and we can try and get you unstuck. 

BRRLL99
11 - Bolide

 

Hi

this is the macro I'm looking for

But the only issue i'm facing while using this macro, since this data headers are sample names

when i tried to insert this macro with original data set, I'm facing error

is there any way where I can choose column headers also dynamically 

Labels
Top Solution Authors