how can I pull in python the historical holding of an etf? for example the holding of XLK.P as of 31-12-2019
Hi @Varun_KC ,
Not sure if this is what you're looking for
import lseg.data as ld ld.open_session() ld.get_data( universe = ['XLK.P'], fields = ['TR.SharesHeldValue'] )
Regarding the data library, here's the introduction video Getting Started with the LSEG Data Library for Python | Developer Community
However, the moderators on this forum do not have deep expertise in every type of content available through LSEG products. Such expertise is available through the Helpdesk (content team). If the Helpdesk can show you how to retrieve it using formula in Workspace Excel, then the moderators on this forum can help you translate it into get_data method in the Data Library call. the Helpdesk can be reached via Home | LSEG Support and you may request from them what data you would like to get the Workspace Excel formula.
@Varun_KC
Is it this one?
ld.get_data( universe = ['XLK.P'], fields = ['TR.FdSecurityOwnedRIC','TR.FdSecurityOwnedName'], parameters = {'SDate':'2019-12-31'})
However, please contact the helpdesk support team directly via LSEG Support to verify it.
Hi Team, lipper team has confirmed below Currently, Workspace Excel can only pull the latest Full holdings of a fund.
To do this, follow these steps in the WS Formula Builder:
1. Go to the Lipper Folder
2. Select Fund Holdings
3. Add the fields TR.FundHoldingName and TR.FundHoldingRIC
For historical full holdings, go to the "Fund Overview" page, select the Holdings tab, and then Derived Holdings. From there, you can toggle the different dates to check historical holdings.
For eg: formula below and attached
=@RDP.Data("XLK.P","TR.FundHoldingName;TR.FundHoldingRIC","StartNum=1 EndNum=200 CH=Fd RH=IN",B2)
The Excel formula can be converted to Python code for the data library as below
import lseg.data as ld import pandas as pd ld.open_session() ld.get_data( universe=['XLK.P'], fields=['TR.FundHoldingName','TR.FundHoldingRIC'] )