question

Upvotes
Accepted
3 0 0 2

rd.get_history() getting data before start date

rics = 'ABB.ST'
start = '2020-01-01'
end = '2024-02-15'

rd.get_history(universe  = rics, fields = "TR.CompanyMarketCap", start = start, end = end)'

I am running the code above and the returned data is as below:

screenshot-2024-05-15-at-092814.png

as start is 2020-01-01 why do I get data for 2019-12-30?

python#product#contentrefinitiv-data-librariesprice-historydate
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
87.2k 294 53 79

@jn02

You can use the Python code to filter dates. For example:

rics = 'ABB.ST'
start = '2020-01-01'
end = '2024-02-15' 
df = rd.get_history(universe  = rics, fields = "TR.CompanyMarketCap", start = start, end = end)
df[(df.index >= start)]
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
87.2k 294 53 79

@jn02

Thank you for reaching out to us.

I used the same function in Excel and got the same result.

=@RDP.Data("ABB.ST","TR.CompanyMarketCap.Date,TR.CompanyMarketCap.calcdate,TR.CompanyMarketCap","Frq=D SDate=2020-01-01 EDate=2024-02-15 CH=Fd RH=IN",B3)

1715761290249.png

I assume that it may use the TR.CompanyMarketCap.Calcdate field for the query.

rics = 'ABB.ST'
start = '2020-01-01'
end = '2024-02-15'
 
rd.get_history(universe  = rics, 
               fields = ["TR.CompanyMarketCap.date",
                         "TR.CompanyMarketCap.Calcdate",
                         "TR.CompanyMarketCap"], 
               start = start, end = end)

1715761370791.png

Please contact the helpdesk support team directly via MyRefinitiv to confirm this.



1715761290249.png (34.8 KiB)
1715761370791.png (17.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

So how should I adjust my code?
Upvotes
15.5k 33 5 10

Hi @jn02 ,

For this field, the function seems to only use calc date as what it got from start-end parameters.

As this is also reflect in the Excel formula, you can contact the helpdesk support as mentioned by my teammate if they have any suggested workaround.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

So I did not get an answer regarding my question about a work around

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.