Forum Discussion

EdwardNg's avatar
EdwardNg
Regular Visitor
6 years ago
Solved

Calculating MTM Value based on Month End Position with Last Price

Hi,

 

I have 2 tables, Price and Transactions. Example as below:

 

Price Table

DateProductPrice
2/1/2020A1.5
29/1/2020A1.3
2/2/2020A1.25
28/2/2020A1.2
2/1/2020B5.1
29/1/2020B5.3
2/2/2020B5.4
28/2/2020B5.55

 

Transactions Table:

TradeDateProductQty
5/1/2020A100
6/1/2020A300
7/1/2020A400
8/1/2020A-200
7/2/2020A-100
8/2/2020A250
5/1/2020B120
6/1/2020B210
7/1/2020B300
8/1/2020B200
7/2/2020B-400
8/2/2020B100

 

I want to calcuate the month end market value based on the last price for the month and accumulated balance for each of the products. 

 

Expected Results:

MonthProductQtyLast PriceMarketValue
JanA6001.3780
JanB8305.34399
FebA7501.2900
FebB5305.552941.5

 

How do i link the tables and calculate the Market value by Month and Product?

 

Thanks

Ed

5 Replies

    • EdwardNg's avatar
      EdwardNg
      Regular Visitor

      for the qty, can we do live-to-date balance instead of just the balances for the month?

       

       

      • EdwardNg's avatar
        EdwardNg
        Regular Visitor

        amitchandak  thanks for the prompt response. 

         

        Also, if i have additional fields in the transactions i want to display in the summary, it gives me a problem. For example if we have product description, it gives the permuatation, as below:

         

         

         

         

         

         

         

        Could you kindly advise? appreciate your thoughts on this.

         

        Many thanks