Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Alteryx macro dynamic Summarize tool

DE22
7 - Meteor

Hello, 

 

Could you, please help me with the topic below?

I need to select a column, based on the previous year for which i run the flow, and that column should be taken by Summarize tool. It should be like a macro, in which you can see all the columns and you can select the one you want to summarized. 

 

Thank you!

 

I attached the sample workflow!

Thank you!

 

Input:

 
ContractEmmision 2023Emmision 2024Emmision 2050
edeneja439154895847384948594
canejkdn883479434556657485

 

Summarize Output:

ContractGroup ByContract
Emmision 2024SumSum_Emmision 2024
2 REPLIES 2
mceleavey
17 - Castor
17 - Castor

Hi @DE22 ,

 

I've attached a workflow that will dynamically select the fields associated to the previous year, which is also automatically determined.

 

The workflow calculates the previous year using the following formula:

DateTimeYear(datetimetoday())-1

 

It then groups this into the control parameter before feeding into the batch macro:

 

McEleavey solution image.png

 

The batch macro pivots the data, filters the data to those rows containing the previous year, then pivots back using the SUM aggregation function.

This gives the following:

 

McEleavey solution image.png

 

I've attached the packaged workflow. I hope this helps.

M.



Bulien

DE22
7 - Meteor

Thank you very much for your great work! It works very good :) 😍

Labels
Top Solution Authors