3
$\begingroup$

I'd like to make a plot of a company's revenue and income over time. I can do this via Wolfram Alpha pretty easily, just by searching "Ford revenue and earnings from 2000 to 2012". As such I can, if necessary, tease out the data from a corresponding WolframAlpha call.

Rather than resorting to Wolfram Alpha, I assumed FinancialData would be more appropriate. Surprisingly, from an initial inspection of the docs, it does not seems like there is an easy way to get these two particular properties.

My question is - can I reliably calculate revenue and/or net income (i.e. profit) from the supported properties of FinancialData? Perhaps based off of EarningsPerShare?

$\endgroup$
4
$\begingroup$

Well, I'm not sure if you could get historical financial highlights from any place rather than SEC itself...

If you want to find historical annual reports per company, please use the following link (remember to substitute "microsoft" with your desired company name):

http://www.sec.gov/cgi-bin/srch-edgar?text=microsoft+10-K&first=2003&last=2013

But if you want to download the last available key statistics, there are many webpages where you can download it. For instance, try to import key statistics directly from Yahoo! Finance using:

Import["http://finance.yahoo.com/q/ks?s=MSFT+Key+Statistics","Data"][[2, 1]][[1, 7]]//TableForm

EDITED

I've done a little research. Please try to use this code:

FordRev=WolframAlpha[#,{{"IQuarterlyValuesTable:Revenue:FinancialData", 1},"ComputableData"}][[5,2]]&/@(StringJoin["ford revenue ",ToString[#]]&/@(2002+Range[10]))

Now see the revenue plot:

ListLinePlot[FordRev]

enter image description here

You can also use:

BarChart[FordRev, ChartLabels -> {2002 + Range[10]}]

enter image description here

For the historical net income use:

FordNet = WolframAlpha[#, {{"IQuarterlyValuesTable:NetIncome:FinancialData",1},"ComputableData"}][[5,2]] & /@(StringJoin["ford net income ",ToString[#]]&/@(2002+Range[10]))

Now you can see the barchart:

BarChart[FordNet, ChartLabels -> {2002 + Range[10]}]

enter image description here

EDITED

You can also "generalize" the code. Try to use:

Rev[x_]:=WolframAlpha[#,{{"IQuarterlyValuesTable:Revenue:FinancialData",1},"ComputableData"}][[5,2]]&/@(StringJoin[ToString[x], " revenue ",ToString[#]]&/@(2002+Range[10]))

Now you compare multiple companies:

ListLinePlot[{Rev[microsoft],Rev[oracle],Rev[GE]}]

The chart:

enter image description here

$\endgroup$
  • $\begingroup$ P.S.: I'm still trying to include the net income historical data... $\endgroup$ – Rod Apr 20 '13 at 15:36
  • $\begingroup$ Thanks for the answer, +1. Like I said in the Q, I already know how to do this through WolframAlpha, I am trying to find a solution using FinancialData. $\endgroup$ – latkin Apr 22 '13 at 22:33
  • $\begingroup$ As far as I know, it's not available such information through FinancialData... $\endgroup$ – Rod Apr 22 '13 at 23:27
2
$\begingroup$

You can get an appropriate series id from here and use the following function.

plotCompanyFundamentalDataOneSeries[symbol_, startDate_, endDate_,id_] := 
  Module[{mycompany, mycompanydata},
  mycompany = EntityValue[Interpreter["Company"][symbol], "Company"];
  mycompanydata =EntityValue[mycompany, 
    Dated[id, Interval[{DateObject[startDate], DateObject[endDate]}]]];
  DateListPlot[mycompanydata, PlotLabel -> symbol <> ":" <> id, 
   PlotTheme -> "Detailed"]]

Example:

GraphicsColumn[{plotCompanyFundamentalDataOneSeries["FORD", {2001, 1, 1}, {2015, 1, 1},
 "TotalRevenue"],plotCompanyFundamentalDataOneSeries["AAPL",
 {2001, 1, 1}, {2015, 1, 1}, "TotalRevenue"]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.