# Why will Wolfram CountryData not give population data after 2014 (e.g. for the US)?

CountryData[ "UnitedStates", {"Population", 2014} ]


322 422 965 people

CountryData[ "UnitedStates", {"Population", 2015} ]


Missing[ "NotAvailable" ]

How can I update it? I am new to Mathematica.

• Both statistics and its implementation in Mathematica are slow. Lags usually equal few years. WolframAlpha in my Mma through ==Population of United States in 2015 answers 320 million people (2015 estimate). – user64494 Jan 17 '19 at 15:55
• Also WA in my Mma answers 327 million people (world rank: 3^(rd)) (2018 estimate) – user64494 Jan 17 '19 at 16:35
• @user64494 That is interesting, WolframAlpha[ "Population of the United States"] for me returns 324 million people (2017 estimate). Seems like there are different data bases queried? – gwr Jan 17 '19 at 17:04
• @gwr: Your question should be addressed to Wolfram developers, not to me. Try WolframAlpha["Population of the United States in 2018"]. Good luck! – user64494 Jan 17 '19 at 17:12
• @user64494 But you indeed have given the answer! Specifically asking for the population in 2018 will give the value you have given. It simply will not appear just asking for population for some reason. :) – gwr Jan 17 '19 at 17:15

CountryData does appear to be out of date, and that is a shame. Many of the XXXData functions now act as wrappers to call EntityValue. Run TracePrint[PlanetData["Venus", "AngularDiameterFromEarth"],_EntityValue] to see that this is true.

But CountryData has not been updated to work this way. So we can call EntityValue directly for the data. To find out what the right syntax would be I will use Ctrl=:

becomes

which is a formatted form of

Entity["Country", "UnitedStates"][
EntityProperty["Country", "Population", {"Date" -> DateObject[{1978}]}]
]


I can query for a date range as well. Using Ctrl= on "US population 2000 through 2018" returns this input expression:

Entity["Country", "UnitedStates"][
EntityProperty["Country",
"Population",
{"Date" -> Interval[{DateObject[{2000}], DateObject @ {2018}}]}
]
]


which returns a TimeSeries object suitable for further computation or visualization.

You should report to WRI. As a workaround you may use the entity functions instead; it is a bit verbose.

First you can get a list of qualifier values of an EntityProperty by

EntityValue[EntityProperty["Country", "Population"], "QualifierValues"]

{Age->{Adult,MiddleAge,PreSchool,SchoolAge,Senior,Young,YoungAdult},
CitizenshipStatus->{BornInPuertoRico,BornInUS,BornToAmericanParents,NaturalizedCitizen,NotCitizen,TotalCitizens},
Date->{},
Gender->{Female,Male},
MarginOfError->{MarginOfError,StandardError},
Percent->{Main},
Race->{AmericanIndian,Asian,Black,NativeHawaiian,Other,TwoOrMore,White,{All,Hispanic}},
TwoOrMore->{ThreeOrMore,TwoIncludingOther},
UrbanRural->{Rural,Urban}}


"Date" is a qualifier. This post gives details on how to specify a "Date" qualifier (156014); an area where the docs can improve.

EntityValue[
Entity["Country", "UnitedStates"],
EntityProperty["Country", "Population", {"Date" -> DateObject[{2015}]}]
]

319,929,162 people


However, you do have a bit more flexibility with this syntax.

EntityValue[
Entity["Country", "UnitedStates"],
EntityProperty["Country",
"Population", {"Date" -> Interval[{DateObject[{2015}], DateObject[{2019}]}]}]
]


and

EntityValue[
Entity["Country", "UnitedStates"],
EntityProperty["Country", "Population", {"Date" -> All}]
]


Hope this helps.