Alteryx Designer Desktop Discussions

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

Need help in building macro

anonymous_111
5 - Atom

Hi,

 

I want to create a macro to update Top 3 countries data for respective accounts in different sheet with sheet name as of Account number.

 

Can someone please suggest workflow?

 

Sample Input Data-

 

AccountCountryWeights
111Australia15%
111UK20%
111USA

 

35%

111China25%
111Germany5%
222Singapore18%
222China28%
222India12%
222Japan35%
222Thailand7%
333Ireland5%
333Poznan25%
333Italy20%
333Switzerland35%
333France15%

 

 

Expected Output data -

 

 
AccountCountryWeights
111USA35%
111China25%
111UK20%

 

AccountCountryWeights
222Japan35%
222China28%
222Singapore18%
6 REPLIES 6
caltang
17 - Castor
17 - Castor

I don't think you need a macro for this. The Sample tool will suffice.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

Like so:

image.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

If you want to output it to multiple sheets, here's how:

image.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

Just be sure to change the Output tool from "Create New Sheet" to "Overwrite..." once you want to run mutliple times after your first run or if the file already exists. 

 

Change the path in the Formula tool to point to where you want to save it. 

 

If the above solved your need, kindly like & mark as accepted solution so that you may help others find the solution more quickly + to close the thread as is. Thanks!

Best regards,
Calvin Tang
https://www.linkedin.com/in/calvintangkw/

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
spunyar
5 - Atom

Thank you for your response. The data posted is just a sample; I have around 100 accounts and want to filter out 10 of them before updating the top three countries and I need data in separate tabs for each account.

 

That's why I was wondering if macro could help me create workflow in fewer steps.

 

 

binuacs
20 - Arcturus

@anonymous_111 macro version

image.png

Labels