Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Transaction as per FIFO

GayatriPanigrahi
8 - Asteroid

Hi All,

 

I am looking help to calculate cost of sale as per buy price till Buy stock get exhausted. 

Calculate of Cost = Buy price * Sales Stock

 

 

Input :

IDBuy - SellPrice Stock Date
AB        84.17   500,000,00001-Jun-22
AB        84.18   200,000,00002-Jun-22
AB        83.18   500,000,00002-Jun-22
AS        81.49- 500,000,00009-Jun-22
AS        81.50- 700,000,00015-Jul-22
AB        81.04   150,000,00008-Aug-22
AB        80.04   150,000,00008-Aug-22
AS        81.14-   50,000,00017-Aug-22
AS        81.14-   50,000,00017-Aug-22
AS        81.20-   75,000,00025-Aug-22
AS        81.20-   75,000,00025-Aug-22
AS        81.27-   50,000,00007-Sep-22
AB        82.68     75,000,00021-Mar-23

 

 

 

Output to calculate Cost :

IDBuyBuy Price Buy StockDate SellPrice Sales Stock  DateCost
(Buy Price * Sales Stock)
AB          84.17                                    500,000,00001-Jun-22      
AB          84.18                                    200,000,00002-Jun-22      
AB          83.18                                    500,000,00002-Jun-22      
                                   1,200,000,000       
      S          81.49-     500,000,00009-Jun-22-420855500
      S          81.50-     700,000,00015-Jul-22584236200
        - 1,200,000,000  
AB          81.04                                    150,000,00008-Aug-22      
AB          80.04                                    150,000,00008-Aug-22      
                                       300,000,000       
      S          81.14-       50,000,00017-Aug-22-40518250
      S          81.14-       50,000,00017-Aug-22-40518250
      S          81.20-       75,000,00025-Aug-22                                    240,609,500
      S          81.20-       75,000,00025-Aug-22 
      S          81.27-       50,000,00007-Sep-22 
        -     300,000,000  
AB82.6751                                      75,000,00021-Mar-23      

 

1 REPLY 1
npariso
10 - Fireball

Hi Gayatri - the following workflow should solve this for you.

 

Let me know if you have any questions surrounding its process!

Labels
Top Solution Authors