Describe the bug
Both the housing stock and household module and the population by type module fail for years prior to 2019. This is because the ACS tables used in the sql/hs_hh/get_tract_controls_hh.sql and get_tract_controls_hhs.sql SQL queries change variable labels starting in 2019.
To Reproduce
-- Check 2018 vs. 2019 for tables B25024 and B09019
-- Notice the ":" characters
DECLARE @year INTEGER = 2019
DECLARE @table NVARCHAR (6) = 'B09019';
SELECT DISTINCT [label]
FROM [acs].[detailed].[values]
LEFT JOIN [acs].[detailed].[geography]
ON [values].[geography_id] = [geography].[geography_id]
LEFT JOIN [acs].[detailed].[variables]
ON [values].[variable] = [variables].[variable]
AND [values].[table_id] = [variables].[table_id]
LEFT JOIN [acs].[detailed].[tables]
ON [values].[table_id] = [tables].[table_id]
WHERE
[tables].[name] = @table
AND [tables].[year] = @year
AND [tables].[product] = '5Y'
Expected behavior
Both SQL queries should use the REPLACE([label], ':', '') logic found in other SQL queries that use ACS data.
Potential resolution
Substitute REPLACE([label], ':', '') where [label] is used in both queries.
Describe the bug
Both the housing stock and household module and the population by type module fail for years prior to 2019. This is because the ACS tables used in the
sql/hs_hh/get_tract_controls_hh.sqlandget_tract_controls_hhs.sqlSQL queries change variable labels starting in 2019.To Reproduce
Expected behavior
Both SQL queries should use the
REPLACE([label], ':', '')logic found in other SQL queries that use ACS data.Potential resolution
Substitute
REPLACE([label], ':', '')where[label]is used in both queries.