Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Datastream /
avatar image
Question by Ed_J · Nov 13, 2019 at 04:07 AM · datastreamrdaterstudio

How to use Data Type "WC07015 - Inactive date (Security)" output

Hello,

When I run a query for datatype WC07015 in a snapshot request (in R) the value it gives me is a character value of numbers that I cannot translate into a date. This data type is supposed to be the day that a company was delisted. How do I convert this value into a date?


sf <- dsws$snapshotRequest(instrument = c("A:EVMX", "A:CBAX"), datatype = c("ISIN", "NAME", "WC07015"), requestDate = "0D")

Running this gives me these outputs:


However if I run the query without the CBA company ticker I get the result I'd expect like this:

Can someone please help me understand why it is doing this, and let me know how to get it to give me a proper date when I run more than one company query.

Thanks,
Ed.

1573617880435.png (9.1 KiB)
1573617929202.png (6.9 KiB)

People who like this

0 Show 0
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.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by jirapongse.phuriphanvichai · Nov 13, 2019 at 06:20 AM

@Ed_J

The column type of WC07015 is converted to <chr> when requesting two items c("A:EVMX", "A:CBAX") because the WC07015 of A:CBAX is "NA".

The workaround is checking if the column of WC07015 is a date, or not.

If it is not date, first you need to remove the "NA" values and then convert the numeric values to date.

The example code is:

sf <- mydsws$snapshotRequest(instrument = c("A:EVMX", "A:CBAX"),
                             datatype = c("ISIN", "NAME", "WC07015"),
                             requestDate = "0D")
if("FALSE"%in%sapply(sf$WC07015, function(x) !all(is.na(as.Date(as.character(x),format="%Y-%m-%d"))))){
    sf[sf == "NA"] <- ""
    sf <- mutate(sf, WC07015= as.Date(as.numeric(WC07015), origin= "1970-1-1"))
}
                     
sf

This code may not cover all use cases.

Otherwise, you may report this issue at DatastreamDSWS2R GitHub.

Comment

People who like this

0 Show 0 · 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.

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

How to get month end data in timeseries request in R

How to get time series of forecast data in R API

I can access DSWS via Excel but not via DatastreamDSWS2R

Package DatastreamDSWS2R error requesting acces Token

Datastream Data availaible via Excel Request-Table - But not via R-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