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?

Best Answer

  • Jirapongse
    Answer ✓

    @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.


Answers

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

  • @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)

  • @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


  • @Jirapongse thank you very much!