question

Upvotes
Accepted
73 2 1 7

Retrieving historical constituent data using R

Hi Team, we have a client that is trying to retrieve historical data using R with the following code:

get_data('0#.KLSE(2018-01-01)', list('TR.InstrumentName', 'TR.CompanyMarketCap(ShType=OUT)'))

rstudio-2tcg9faionklse.png

but they are not able to retrieve it. Client said they were able to retrieve this previously with the below image similar output.

rstudio-pkcufo7lhv.png

I would like to emphasize that client is using R and not Python -- can you advise of possible cause of error for this? Why client can no longer retrieve historical constituents and market cap on R?

eikon-data-apirrefinitiv-data-platform-eikonconstituents
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
78.6k 248 52 74

@paulcerillo

The problem can be replicated in Eikon Excel.

1686208846268.png

1686208871107.png


Please contact the Eikon support team directly to verify what the problem is.



1686208846268.png (7.9 KiB)
1686208871107.png (23.5 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.

Hello @Jirapongse , thank you. Your reply made me realized that TR.InstrumentName is not the correct data item to retrieve historical composition.

Upvotes
73 2 1 7

@Jirapongse One last question please --
Do you know how this excel formula should be written in R?

=@TR(".KLSE","TR.IndexConstituentRIC;TR.IndexConstituentName;TR.IndexConstituentWeightPercent;TR.IndexConstituentShares","SDate=#1 CH=Fd RH=IN;date;calcdate",D4,20191224)

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
78.6k 248 52 74

@paulcerillo

Please try this one:

data_frame2 <- get_data(".KLSE", 
                        list("TR.IndexConstituentRIC","TR.IndexConstituentName","TR.IndexConstituentWeightPercent","TR.IndexConstituentShares"),
                        list("SDate"="20191224"))
data_frame2

The output is:

1686217019505.png



1686217019505.png (45.7 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.

@Jirapongse thank you very much!

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.