Happy 8th birthday to the Maveryx Community! Take a walk down memory lane in our birthday blog, and don't miss out on the awesome birthday present that all Maveryx Community members get to take advantage of!
alteryx Community

# Alteryx Designer Desktop Discussions

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

## Calculate the amount to a specific value and any remaining to calculated

8 - Asteroid

Hi guys,

I am in a situation which I need some help on Alteryx.

I have the following situation:

 Employee Share Purchase Date Amount of Shares 111 03/05/2013 5 111 17/11/2012 14 111 10/11/2012 10 111 07/07/2012 5 111 04/04/2012 6 111 15/11/2011 15 111 05/10/2011 10 111 02/03/2011 10 111 01/02/2010 5

So I need to pick the first 45 shares (in this case the earliest shares purchased), sum up until 45 shares, then recalculate to the number of shares are correct and in line. So my goal is to achieve the 'new amount of shares' column

 Employee Share Purchase Date Amount of Shares First 45 shares New Amount of Shares 111 03/05/2013 5 5 111 17/11/2012 14 14 111 10/11/2012 10 10 111 07/07/2012 5 5 111 04/04/2012 6 5 1 111 15/11/2011 15 15 0 111 05/10/2011 10 10 0 111 02/03/2011 10 10 0 111 01/02/2010 5 5 0

Much appreciated for any help.

Kind Regards,

Dan

3 REPLIES 3
12 - Quasar

Hi @DanielCarro ,

Here is one way of accomplishing the calculation. I added a second input in case not all employees have the same 45 shares.

8 - Asteroid

Amazing, worked like a charm

8 - Asteroid

Thank you @phottovy

Labels