Hopefully there haven't been any issues, but if there are and our docs don't cover it please reach out.
Your comprehensive geographic reference
Enhance your analytical capabilities with the country dimension table that leverages ISO 3166 standards. This dimension provides a robust, standardized framework for geographic data analysis, enabling precise reporting, seamless data integration, and simplified compliance across global business operations. Key benefits include consistent country representation, improved data quality, and the ability to generate granular insights by efficiently segmenting and analyzing data at the country level.
Ideal for organizations seeking to:
Includes comprehensive ISO country code mappings, allowing for accurate and scalable international data management.
The country dimension table contains the following fields (examples in parentheses):
1. name: Then generally used name for a country (United States)
2. alpha_2: The two letter code used to identify a country (US)
3. alpha_3: The three letter code used to identify a country (USA)
4. common_name: If applicable, a separate name used for the country. Filled with the name if not applicable. (United States)
5. official_name: If applicable, the official name used for the country. Filled with the name if not applicable. (United States of America)
6. numeric_code: Similar to alpha_3, a three digit code used to identify countries (840)
7. flag: the UTF-8 (Unicode) emoji flag of the identified country. (🇺🇸)
Example to pull from the dimension table
select
country.name,
count(transaction.id) as transaction_counts
from your_transaction_table as transaction
inner join douro_data.country_dimension as country
on transaction.country_id = country.country_id
group by
country.name
Example to insert into fact with fallback Kimball row
select
source.id,
source.transaction_amount,
source.transaction_created,
coalesce(country.country_id, -1) as country_id
...
from source_table as source
left outer join douro_data.country_dimension as country
on source.alpha_2_country_code = country.alpha_2
This is an important note copied over from the pycountry repository, which feeds the data for this dimension.
No changes to the data will be accepted into pycountry. This is a pure wrapper around the ISO standard using the `pkg-isocodes` database from Debian as is. If you need changes to the political situation in the world, please talk to the ISO or Debian people, not me.
By using the country dimension table, you can easily perform more sophisticated region-based analyses and create consistent, reliable reports across your data warehouse.
Please reach out to us with any questions or suggestions at support@dourodata.com or use the form above!