Closed AntonioFasano closed 2 years ago
In general it is best to not assume Rblpapi
to be any sort of Excel clone or replacement. The package accesses a published API which permits you to access resources offered by the backend, chiefly data and calculation access.
What you do with the retrieved information is up to you. R offers a multitude of ways to generate reports (there must a be hundreds of RMarkdown extension packages) including just about any format known to man as pandoc
can convert.
This division of labor follows standard practice and makes sense for most of us.
I'm not sure I understand the question. Is there a case where you get an unexpected result from R? It's very hard to troubleshoot something that seems to be working.
Perhaps the question title created confusion. The fact that I exported an FA screen to Excel was intended only to identify the relevant arguments for the API call.
Let me try to rephrase my question like follows:
What is the correct Rblpapi
line to retrieve the Apple ROE in the third quarter 2019?
We are not here to provide that level of service.
My suggestion is to duplicate your test over a wide range of stocks, so that you can verify that the method you are using in Rblpapi matches excel.
OK, and, please, do you have any Rblpapi
example retrieving a balance sheet item? (whatever item or quarter)
For FA level data I would recommend looking at EQS screens in Bloomberg, and subsequently the beqs()
function in RblpApi
Thank you, @csrvermaak.
While this could be a useful workaround, my objective is to obtain a valid Rblpapi
line to retrieve fundamental data, such as a balance sheet item, which I think could be of interest to many.
I have shared my bdh
version, maybe someone will improve it.
When exporting a financial report in Excel, data cells are typically like follows (newlines added for readability):
Such a formula shows the value 52.69.
I am translating this into R like follows:
The arguments from the last line of the Excel formula:
appear to be Excel specific, and affecting only the data layout.
Period="FQ"
seems not effective in R.The result is:
While results match, it could be sheer luck. Is this the conversion method that you too are following?