YCS calls pulling 0s for most recent figures if they the data is either 0 or null

James Han shared this problem 7 years ago
Known

Email 1

Hi Kim,

I hope this email finds you well. I have a question on how I can best pull in data from YCharts to Excel. I have been using this tool for almost two years now, so I’m pretty comfortable with it. However, when I try to pull in a company’s current debt or long-term debt, the data usually needs to be double-checked, which adds a lot of work to my data collection. This is what’s happening: I try to pull in debt amounts for the last 6 quarters and the quarterly data is incorrect.

For example, when I try to pull in debt data for CORT, it comes through like this:

Current Debt (mil) (last 6 quarters)
Current Debt (mil) (last 6 quarters)
1
2
3
4
5
6
5
10
15
Do you know a way that I can pull the data so it comes through with the correct values in the prior 6 quarters?


I came back with use YCP or keep YCS and do index matches


Email 2

Hi James,

Thank you for reaching out. Yeah, if YCharts could actually enter a “0” when there is no debt (or another metric like dividends or stock buybacks) so “0” would be retrieved when I pull a string of data, that would go a long ways in helping me collect data more expediently.

I’ve used the YCP system before and it’s actually a worse method to use simply because not all stocks’ data is updated simultaneously on the same day each quarter. So for CORT, when I use YCP, I get this output:

Current Debt (mil) (last 6 quarters)
6/30/2018
3/31/2018
12/31/2017
9/30/2017
6/30/2017
3/31/2017
5
10
This is wrong, because the data hasn’t been updated since March 31, so I’m pulling in an artificial “0” for June 30, 2018 when the company hasn’t even released data yet. When I’m pulling data in for stocks, I’m not doing this one stock at a time. I’m updating data for 500 stocks per week, so I don’t want to take the time to see when each stock last updated their data and make sure I have the correct data for the 6 most recent quarters. And I’d have to have 6/30/18 data being pulled, because some companies have updated through this time frame. Depending on the stock, their most recent data could’ve been updated in December or June or some other random month.

I just want to be able to tell my spreadsheet to pull the most recent six quarters of data and have confidence that zeroes will fill in when they should (instead of data from 4 quarters ago appearing like it was data from the most recent quarter). Please let me know if you have any questions on what I’m trying to do. Thank you for your help on this James!


Ben Brocker

Replies (7)

photo
1

Sorry i don't really understand this... what is the error?

This comment is in trash! Restore
photo
1

Darn, the text got messed up.

If you perform a YCS for any metric that doesn't have any recent figures or has a 0, it skips those dates/figures and pulls in the last date with a figure and before.

63b2ad30118073c31e4943bcfaed8e2f

Please take a look at the image... hopefully it helps.

This comment is in trash! Restore
photo
1

OK this makes sense can you link to the what metric this is for CORT? (on the data page).

This comment is in trash! Restore
photo
1

Also the exact YCS call made would help

This comment is in trash! Restore
photo
1

the specific metric is "ltd_and_capital_lease_obl" and the YCS formula is below


=YCS("CORT", "ltd_and_capital_lease_obl", -40,,"y",,"y")

This comment is in trash! Restore
photo
1

Remind me what the arguments for YCS mean

This comment is in trash! Restore
photo
1

Here is the link to the actual page: https://ycharts.com/companies/CORT/ltd_and_capital_lease_obl


YCS ( Ticker, Metric, Date, "-" , reverse (ascending/descending), "-" , retrieve dates )

This comment is in trash! Restore
Leave a Comment
 
Attach a file
You can't vote. Please authorize!