Tag Archives: report

PL reports – solutions

Shazmd asked a question through the forum about how to make a report giving out PL as of 3 dates.

There are couple of solutions to this question and which one you need to use is totally up to you 🙂

First thing to keep in mind is that when people mention reports it should not always equal datamart. For instance, simulation is a live report showing the risk and which could fetch data as of couple of days in the past.

Trade query is also in a way a report, with no calculated data. So it is important to understand what is the end user after so you give him/her the most appropriate solution.

  1. User definable P&L notepad

This first solution is probably the simplest and is perfect if the request is just a one off that would not repeat very frequently. User definable notepad is a dynamic table based on PL, there is just a direct menu to access it. So if you search for it (it is under middle office, P&L related procedure (or just type in the search notepad)) and get into it, Murex will ask you to choose a filter. Space bar on the default one. You then see a filter screen. You have 3 dates you can choose from (Inception means not calculated) and you can pick a portfolio or any other criteria. The data for the 3 dates will be computed when you validate the filter.

You then get a matrix will all the deals selected and the data you need. Just change the view to be what you need using Tools-View and choose the columns which make sense. You will see some fields available 3 times, they are the data computed as of the 3 different dates. Just change from description to field name. The field ending in 0 corresponds to the data for the first date selected, the one ending in 1 corresponds to the data for the 2nd date selected and the last one ending in 2 corresponds to the data for the 3rd date selected.

You can then copy paste (ctrl-shift-C to copy all lines) the results or export them from the file menu. You can then work out the data in Excel.

2. Datamart

Datamart for 3 PL dates is the 2nd solution. It is easy to re-use and the format will be up to you.

First of all, you need to choose which engine to use for computing the data (note that it is using the same code underneath but there could be differences in usage). The first one is a dynamic table of type PL (TRNRP_PL). You need to define one and choose the fields you want. Remember that you can test a dynamic table to check if the content is ok. The dynamic table should produced only 1 set of PL result not 3.

Once you’re happy with the dynamic table, you need to wrap it so that it will produce data into the datamart. To do so (and in high speed): you will need to define a feeder and then inject that feeder into a batch of feeders. The feeder will go through creating a table in the datamart and attaching data to it (data coming from your dynamic table). When you define your batch of feeders make sure that you can have at least 1 set per date so that data in the datamart is historized.

Just run the batch of feeders as of the 3 dates you need to compute (you might need to amend the global filter within the batch of feeders to choose which date).  Once your datamart is populated with the data (you can query it and check by SQL for example). You need to build an extraction to retrieve that data. The extraction will be an SQL piece of code which you can make fancy by letting the user choose the 3 dates he wants to query on (or you can hardcode it).

Finally, you need to format the output, csv file format requires no work, but if the user wants to look at the results on screen you’ll need to have a viewer with your field to be nicely formatted. I usually don’t recommend to format the excel file via the viewer as dates come back sometimes not as wanted, or fields formatting might require extra work.

And that’s it you’ve got a datamart with your 3 dates. The first time you will do it, you will get it wrong and it will take some time but once you start getting the hang of it, it becomes much much smoother.

3. Simulation

And yes there is another option: simulation. Simulation is a live report showing live position, cash flow, PL, etc… In simulation, build a viewer to show your PL with as much breakdown as you would like.

You can then define a dynamic table based on that simulation view. Create a feeder and batch of feeder on top. Then compute the PL data as of the 2 days in the past you need. Simulation will always compute PL as of today.

Then back in your simulation view, you can add more of the same PL fields and right click on them, output settings and select stored data. You can then choose to retrieve the data from your datamart directly in simulation and display either the datamart number or the variation with the current data. You can also choose to retrieve based on a shifter (like the day before, 1 month before, first day of the month, etc…) and you can do it as many times as you like (and as you have data of course!).

In a nutshell, that’s how you can solve your problem of a report showing PL as of 3 dates. I am sure you will have tons more questions, feel free to experiment, check your environment for already existing examples and ask here if you’re stuck!