Time Series of Analytics / Python

Hi Everyone I am using the python function ek.get_data to source the field TR.AccruedAmountAnalytics. However, I can only source the accrued amount for one valuation date. Is there a possibility to source multiply valuation dates beside creating a loop? Thanks Jurij

Best Answer

  • @jurij.reichenecker yes so this field takes a number of parameters - ValuationDate and SettlementDate, amongst others (you can see all of these in the Parameters section of the Data Item Browser app (type DIB into eikon search bar).

    ValD = ['2021-02-03','2021-02-04','2021-02-05']
    data1 = pd.DataFrame()

    for d in ValD:

        df,err = ek.get_data('34540TKR2', ['TR.AccruedAmountAnalytics'],
                            parameters={"ValuationDate": d, "SettlementDate": d})
        df['Date'] = d
        if len(df):
            data1 = pd.concat([df, data1], axis=0)
        else:
            data1 = df
                
    data1

    image

    Is this the kind of thing you were looking for? Obviously you can adjust the parameters as you like. I hope this can help.

Answers

  • Hi @jurij.reichenecker,

    The Data Item Browser shows that TR.AccruedAmountAnalytics is not a series field, so you won't be able to request it with a date range. Using a loop, seems to be the only plausible option.