6
$\begingroup$
WolframAlpha["Apple company revenue", {{"Result", 1}, "Plaintext"}]

enter image description here

Desired output

182800000000

WolframAlpha["Apple company interest expense", {{"Result", 1}, "Plaintext"}]

enter image description here

Desired output

384000000

WolframAlpha["Apple company employees", {{"Result", 1}, "Plaintext"}]

enter image description here

Desired output

97000

WolframAlpha["Sony company revenue", {{"Result", 1}, "Plaintext"}]

enter image description here

Two questions:

(a) How can I efficiently automate this?

(b) How can I convert Sony from Yens to Dollars?

$\endgroup$
9
$\begingroup$
QuantityMagnitude[WolframAlpha[#, {{"Result", 1}, "ComputableData"}]] & /@  
   {"Apple company revenue",  "Apple company interest expense", "Apple company employees"}
(* {1.828*10^11, 3.84*10^8, 97000} *)

Update: Exchange rate conversion

WolframAlpha[#, {{"Result", 1}, "ComputableData"}] & /@ 
  {"Sony company revenue", "Sony company interest expense"}

enter image description here

UnitConvert[WolframAlpha[#, {{"Result", 1}, "ComputableData"}], "Dollars"] & /@
    {"Sony company revenue", "Sony company interest expense"} 

enter image description here

QuantityMagnitude[UnitConvert[WolframAlpha[#, {{"Result", 1}, "ComputableData"}],
   "Dollars"]] & /@ {"Sony company revenue", "Sony company interest expense"}
(* {6.9513*10^10, 3.73491*10^9}}  *)
$\endgroup$
  • $\begingroup$ So nice! I didn't know ComputableData. I don't want to be overdemanding. But, how would you handle the different currencies? $\endgroup$ – eldo Nov 8 '14 at 20:58
  • $\begingroup$ @eldo, just posted an update to handle exchange rate conversion. $\endgroup$ – kglr Nov 8 '14 at 21:09

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.