# How to show net income geographically of a company in a certain city

Let's say that I have a company, and I already extracted it's net profit with time series.

Nvidia = Entity["Company", "NVIDIACorporation::7ymsk"][
EntityProperty["Company",
"NetIncome", {"TimeSeriesType" -> #,
"Date" -> All}]] & /@ {"TTM"}

Now I have stored the data in the variable "data". How could I show dynamically by time this net profit geographically based on their headquarters in comparison to the other companies, that also have headquarters nearby.

What I want it, is to show a map with a circle around the dot where the headquarters of the company are located, the radius would show the net income. And then compare that circle with other companies that are in close proximity. With this I could see geographical comparison of net profits of different companies all located for example in Silicon Valley.

Is this possible to do with Mathematica?

• It is certainly possible but you need to decide on the details. Read the help files about using geographical information. Apr 15, 2021 at 2:18

Mathematica has the tools to display a geographical comparison of the net profits of different companies. The Company entity (version 12 and later) has NetIncome and Position properties that GeoBubbleChart can display. Here's a demonstration of one possible way to show a comparison. We need position and income data for each company for the GeoBubbleChart map.

Let's simplify by using the net income value instead of the time-series data, and use NVIDIA's location as the center of a map. Use EntityPrefetch to get the position data.

EntityPrefetch[EntityProperty["Company", "Position"]]
pos = Entity["Company", "NVIDIACorporation::7ymsk"]["Position"];

Now get the list of companies that are within 10 miles of NVIDIA's location. Some companies don't have locations, so ignore them. There are 944 companies, far too many for a meaningful map, but some have no net income and others have negative values. Simplify by mapping only the companies with positive net income.

nearbyCompanies = EntityList[
FilteredEntityClass["Company",
EntityFunction[c,
! MissingQ[c["Position"]] &&
GeoDistance[c["Position"], pos] < Quantity[10, "Miles"]]]];
Length[nearbyCompanies]
(* 944 *)

netIncomeList =
Select[DeleteMissing[
EntityValue[nearbyCompanies, {"Position", "NetIncome"}, "EntityAssociation"],
1, \[Infinity]], QuantityMagnitude[Last[#]] > 0 &];
Length[netIncomeList]
(* 80 *)

Here are ten companies with the largest net income.

TableForm[
Normal[TakeLargestBy[netIncomeList, Last, 10]] /. Rule -> List]

Use GeoBubbleChart to display circles scaled to each company's net income, and a circle that shows the 10-mile limit. The largest bubbles represent the companies with the highest net income (Apple is easily identified as the largest bubble).

geoNetList = Rule @@@ Values[netIncomeList];
Show[
GeoGraphics[{EdgeForm[Black], Red,
GeoDisk[pos, Quantity[10, "Miles"]]}],