Add region dimension to Orders model for geographic revenue analysis - #128
Open
lightdash[bot] wants to merge 1 commit into
Open
lightdash[bot] wants to merge 1 commit into
lightdash[bot] wants to merge 1 commit into
Conversation
## Summary - Adds a `region` additional dimension to `dbt_orders` derived from the existing `shipping_country` column via a CASE expression in the semantic layer YAML - Maps countries to EMEA, APAC, Americas, or Other using standard geographic groupings - Adds `ai_hint` to both `region` and `shipping_country` to route agents: Region for broad groupings (EMEA/APAC/Americas), Shipping Country for country-level analysis - No changes to dbt model SQL or any other fields ## Review finding addressed The Orders explore could not answer "revenue by region" because it exposed `shipping_country` but no region dimension. This change adds the missing semantic-layer grouping without touching model logic. ## Test plan - [ ] Verify `region` dimension appears in the Orders explore in Lightdash - [ ] Confirm "Revenue by Region" chart groups correctly into EMEA / APAC / Americas / Other - [ ] Confirm `shipping_country` still works for country-level breakdowns - [ ] Check that the `ai_hint` text routes AI queries to the right dimension 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: lightdash[bot] <183517231+lightdash[bot]@users.noreply.github.com> Co-authored-by: Rohan Bedi <rohan@lightdash.com>
Lightdash Validation Results
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
regionadditional dimension todbt_ordersderived from the existingshipping_countrycolumn via a CASE expression in the semantic layer YAMLai_hintto bothregionandshipping_countryto route agents: Region for broad groupings (EMEA/APAC/Americas), Shipping Country for country-level analysisReview finding addressed
The Orders explore could not answer "revenue by region" because it exposed
shipping_countrybut no region dimension. This change adds the missing semantic-layer grouping without touching model logic.Test plan
regiondimension appears in the Orders explore in Lightdashshipping_countrystill works for country-level breakdownsai_hinttext routes AI queries to the right dimension🤖 Generated with Claude Code