Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /
avatar image
Question by Charles · Oct 07, 2016 at 12:33 AM · apipythondata_grid

Request same field with different parameters in data_grid

If I do a request like the following:

ek.get_data('BHP.AX', ['TR.TradePriceClose', ('TR.TradePriceClose', {'Curn': 'USD'})])

The second TradePriceClose field (in USD) doesn't come through as an additional column as expected whereas this works fine in say excel, or through the COM apis (Dex2).

Instead what appears to be happenning is it is collapsing the data by bare field name (not including parameters) causing it to get folded together with the first field as a single column in the response, leaving only one instance of TradePriceClose in the returned json headers. Using either by itself works fine. Is there some way of modifying the request in data_grid to avoid this (eg passing some different parameters)?

People who like this

0 Show 1
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Charles · Oct 07, 2016 at 05:47 AM 0
Share

It seems to work if I add a .value suffix to both fields, and put the USD one first, otherwise I get two identical columns. Can't quite figure make sense of this one.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by jirapongse.phuriphanvichai · Oct 11, 2016 at 10:53 PM

I got the same result as yours.

The following is the Request and Response after using the above code.

Request

{
  "Entity": {
    "W": {
      "fields": [
        {
          "name": "TR.TradePriceClose"
        },
        {
          "parameters": {
            "Curn": "USD"
          },
          "name": "TR.TradePriceClose"
        }
      ],
      "instruments": [
        "BHP.AX"
      ]
    },
    "E": "DataGrid"
  }
}

Response

{
    "columnHeadersCount": 1,
    "data": [
        [
            "BHP.AX",
            23.8
        ],
        [
            "BHP.AX",
            23.8
        ]
    ],
    "headerOrientation": "horizontal",
    "headers": [
        [
            {
                "displayName": "Instrument"
            },
            {
                "displayName": "Trade Price Close",
                "field": "TR.TRADEPRICECLOSE"
            }
        ]
    ],
    "rowHeadersCount": 1,
    "totalColumnsCount": 2,
    "totalRowsCount": 3
}

However, if I use your workaround, I can get the correct data.

Request

{
  "Entity": {
    "W": {
      "fields": [
        {
          "name": "TR.TradePriceClose.value",
          "parameters": {
            "Curn": "USD"
          }
        },
        {
          "name": "TR.TradePriceClose.value"
        }
      ],
      "instruments": [
        "BHP.AX"
      ]
    },
    "E": "DataGrid"
  }
}

Response

{
  "columnHeadersCount": 1,
  "data": [
    [
      "BHP.AX",
      17.933300179333,
      23.8
    ]
  ],
  "headerOrientation": "horizontal",
  "headers": [
    [
      {
        "displayName": "Instrument"
      },
      {
        "displayName": "Trade Price Close",
        "field": "TR.TRADEPRICECLOSE(Curn=USD).value"
      },
      {
        "displayName": "Trade Price Close",
        "field": "TR.TRADEPRICECLOSE.value"
      }
    ]
  ],
  "rowHeadersCount": 1,
  "totalColumnsCount": 3,
  "totalRowsCount": 2
}

This could be the problem in Data Grid. I will contact Data Grid team to verify the issue.

Comment

People who like this

0 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Charles · Oct 13, 2016 at 02:43 AM 0
Share

Thanks for taking a look. Note that it is also reproducible in excel, ie this formula doesn't work correctly unless you flip the order:

=TR("BHP.AX","TR.TradePriceClose;TR.TradePriceClose(Curn=USD)","CH=Fd",B2)

So this has the potential to trip up many more people than just those using DataGrid via the scripting API or JET. Another thing to note is that it works fine with TR.PriceClose, so it is something peculiar to these items (which I believe get pulled from a different source than data cloud?).

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
7 People are following this question.

Related Questions

Is there a way to get AI for bonds with no RIC assigned by using Python API?

Where do I find my app key so I can use EIKON API with Python?

Python Eikon API - Insufficient Data

Eikon permission error

Companies missing from historical ASX 100 data retrieved with Python API

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges