BEA : Duplicates series names
In short
As noted by @thomasbrand here, many series have the same name, but not the same code, and not the same observations.
Unfortunately, there is no information in API that could help us to get the entiere name.
Examples
Some random examples:
- https://next.nomics.world/BEA/FixedAssets-26?dimensions=%7B%22concept%22%3A%5B%22equipment%22%5D%7D
- https://next.nomics.world/BEA/NIUnderlyingDetail-U4030B?dimensions=%7B%22concept%22%3A%5B%22plus-adjustment-for-u-s-territories-and-puerto-rico%22%5D%7D
- https://next.nomics.world/BEA/FixedAssets-102?dimensions=%7B%22concept%22%3A%5B%22buildings%22%5D%7D
- https://next.nomics.world/BEA/NIPA-T10103?dimensions=%7B%22FREQ%22%3A%5B%22Q%22%5D%2C%22concept%22%3A%5B%22services%22%5D%7D
- https://next.nomics.world/BEA/NIPA-T10202?dimensions=%7B%22FREQ%22%3A%5B%22Q%22%5D%2C%22concept%22%3A%5B%22change-in-private-inventories%22%5D%7D
- https://next.nomics.world/BEA/NIPA-T70406?dimensions=%7B%22FREQ%22%3A%5B%22A%22%5D%2C%22concept%22%3A%5B%22farm-housing%22%5D%7D
- https://next.nomics.world/BEA/NIUnderlyingDetail-U001A2?dimensions=%7B%22FREQ%22%3A%5B%22M%22%5D%2C%22concept%22%3A%5B%22chemical-and-allied-products%22%5D%7D
- https://next.nomics.world/BEA/NIUnderlyingDetail-U31200?dimensions=%7B%22FREQ%22%3A%5B%22Q%22%5D%2C%22concept%22%3A%5B%22benefits-from-social-insurance-funds%22%5D%7D
- https://next.nomics.world/BEA/NIUnderlyingDetail-U90500?dimensions=%7B%22FREQ%22%3A%5B%22A%22%5D%2C%22concept%22%3A%5B%22personal-consumption-expenditures%22%5D%7D
- https://next.nomics.world/BEA/FixedAssets-105?dimensions=%7B%22concept%22%3A%5B%22equipment%22%5D%7D
Thomas's example
In brief
Let's take Thomas's example: https://next.nomics.world/BEA/NIPA-T70100?dimensions=%7B%22FREQ%22%3A%5B%22Q%22%5D%2C%22concept%22%3A%5B%22gross-domestic-product%22%5D%7D
Problem: A939RC-Q
and A939RX-Q
series have the same name returned by API: "Gross domestic product"
The names should be: "Gross domestic product - current dollars" and "Gross domestic product - Chained (2009) dollars"
Details
In source data, we have :
-
for
A939RC-Q
:{ "CL_UNIT":"Level", "DataValue":"1,698", "LineDescription":"Gross domestic product", "LineNumber":"1", "METRIC_NAME":"Ratio", "SeriesCode":"A939RC", "TableName":"T70100", "TimePeriod":"1947Q1", "UNIT_MULT":"0" }, { "CL_UNIT":"Level", "DataValue":"1,713", "LineDescription":"Gross domestic product", "LineNumber":"1", "METRIC_NAME":"Ratio", "SeriesCode":"A939RC", "TableName":"T70100", "TimePeriod":"1947Q2", "UNIT_MULT":"0" }, { "CL_UNIT":"Level", "DataValue":"1,731", "LineDescription":"Gross domestic product", "LineNumber":"1", "METRIC_NAME":"Ratio", "SeriesCode":"A939RC", "TableName":"T70100", "TimePeriod":"1947Q3", "UNIT_MULT":"0" }, ...
-
for
A939RX-Q
:{ "CL_UNIT":"Level", "DataValue":"13,513", "LineDescription":"Gross domestic product", "LineNumber":"10", "METRIC_NAME":"Ratio", "SeriesCode":"A939RX", "TableName":"T70100", "TimePeriod":"1947Q1", "UNIT_MULT":"0" }, { "CL_UNIT":"Level", "DataValue":"13,437", "LineDescription":"Gross domestic product", "LineNumber":"10", "METRIC_NAME":"Ratio", "SeriesCode":"A939RX", "TableName":"T70100", "TimePeriod":"1947Q2", "UNIT_MULT":"0" }, { "CL_UNIT":"Level", "DataValue":"13,362", "LineDescription":"Gross domestic product", "LineNumber":"10", "METRIC_NAME":"Ratio", "SeriesCode":"A939RX", "TableName":"T70100", "TimePeriod":"1947Q3", "UNIT_MULT":"0" }, ...
Conclusion
No information is given by API to get full series name as API only return sheet lines that have data (and "Current dollars" and "Chained (2009) dollars" lines in sheet have no data, they are not present in file).
To get full series names; we would have to parse all that sheets, remember series positions in "tree", looks for names collisions and rename series if collisions appears. This is not trivial and there are several problems that would appear:
- are all series available in website front (or XLS files) ?
- in some cases, "tree" is quite big, like in that case