ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Need Capital/Gain Calculation in Alteryx Designer

Tej_Singh
8 - Asteroid

Hi Team,

 

I wish to create a Capital Gain calculation output using Alteryx Designer. To make things clear I am attaching an excel file "Capital-Gain Calculation.xlsx" which has the following worksheets:

 

Data - Data as received in Input. Need to Calculate two columns over here "Basket Trend" and "Price per share". For formula please select cell and you will get it. 

 

OUTPUT Calculation - Manual Calculation as done in excel (For a given CONCAT at each SELL Transaction we need to do a Capital Gain  calculation by squaring off the Sell quantity to the Buy Quantity available at that SELL Transaction date). Need to implement this calculation in Alteryx Workflow.

 

Output Required - Desired Output in excel format from Alteryx Designer Workflow

 

Looking forward for your valuable insights and solution.

 

Best Regards,

Tej

4 REPLIES 4
Tej_Singh
8 - Asteroid

Can anyone suggest if there is a solution to achieve this output in Alteryx?

CoG
14 - Magnetar

The short answer is yes, but it would be tricky to implement, requiring what I think will only need to be a double-nested iterative macro. What would happen in the event (or is it even possible) that the calculations end with pending sell qty?

CoG
14 - Magnetar

A few things I'm not certain of with regards to the output, but I did manage to build a workflow that meets the expected output! This was quite fun to put together and involved a nested iterative macro in a batch macro. Here you are.

 

Batch:
Batch Macro.png

Iterative Macro 1:

Iterative Macro 1.png

Iterative Macro 2:

Iterative Macro 2.png

Tej_Singh
8 - Asteroid

Thanks @CoG.  I will definetly check and revert back. Thank you so much for taking out time and providing a possible solution to my problem.🙏

Labels
Top Solution Authors