Skip to content

Commit

Permalink
add classification NAICS in cbp cube
Browse files Browse the repository at this point in the history
  • Loading branch information
hermosillajelmy committed Oct 16, 2024
1 parent fbf446a commit 1f91b33
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions schema/cbp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@

<DimensionUsage name="NAICS" source="BLS Industry Flat" foreign_key="naics" />

<Dimension foreign_key="classification" name="Classification NAICS">
<Hierarchy name="Classification NAICS">
<InlineTable name="dim_naics_flat" format="tuples">
<Row>("id_naics", "description_naics")</Row>
<Row>(0, "Unknown levels")</Row>
<Row>(1, "Sector")</Row>
<Row>(2, "Subsector")</Row>
<Row>(3, "Industry Group")</Row>
<Row>(4, "Industry")</Row>
<Row>(5, "National Industry")</Row>
</InlineTable>
<Level key_column="id_naics" name="Classification NAICS" name_column="description_naics" key_type="u8" />
</Hierarchy>
</Dimension>

IF(num_digits = 2, 'Sector',
IF(num_digits = 3, 'Subsector',
IF(num_digits = 4, 'Industry Group',
IF(num_digits = 5, 'Industry',
IF(num_digits = 6, 'National Industry', ''))))) AS classification

<Dimension name="Year" foreign_key="year" type="time">
<Annotation name="dim_type">TIME</Annotation>
<Hierarchy name="Year" primary_key="Year">
Expand Down

0 comments on commit 1f91b33

Please sign in to comment.