Comments (2)
Hey @gowthamgutha, thanks for opening an Issue. I'm gonna change this to a feature request since we're aware of this limitation. We currently only allow 2 hops, mainly because adding a third hop greatly increases the complexity of the join resolutions paths, and opens up a lot of ambiguous join paths.
It's something we're aware of, and we've already started doing some work to better handle ambiguous join resolution. Take a look at this PR for an example: #914.
The recommended path right now is to do some denormalization in dbt if you need metricflow to be able to join across more than 2 hops.
from metricflow.
Thanks for the update @Jstein77 . I've used de-normalized views to solve my use-case.
m_address.sql
{{ config(schema='Person') }}
select sp.Country, Person.Address.* from Person.Address left outer join {{ref('m_stateprovince')}} as sp on Person.Address.StateProvinceID = sp.StateProvinceID
m_stateprovince.sql
{{ config(schema='Person') }}
select Person.CountryRegion.Name as Country, Person.StateProvince.* from Person.StateProvince left outer join Person.CountryRegion on Person.StateProvince.COUNTRYREGIONCODE = Person.CountryRegion.COUNTRYREGIONCODE
The above two models have been changed to facilitate the use-case sumlinetotal by billing country.
The actual linkable dimension path ought to be sales_order_id__bill_to_address_id__state_province_id__country_region_id__country_name
.
Now, with the below semantic model changes for billtoaddress, we can make sales_order_id__bill_to_address_id__country
since we added the country
in the m_address
as shown above, so it can become a dimension in the billtoaddress
semantic model.
- name: billtoaddress
defaults:
agg_time_dimension: modified_date
description: |
sales order header
model: ref('m_address')
entities:
- name: bill_to_address_id
type: primary
expr: AddressID
- name: state_province_id
type: foreign
expr: StateProvinceID
dimensions:
- name: country
expr: Country
type: categorical
- name: city
expr: City
type: categorical
- name: modified_date
expr: ModifiedDate
type: time
type_params:
time_granularity: month
from metricflow.
Related Issues (20)
- [SL-1604] [Feature] Enable querying cumulative metrics with their agg_time_dimension
- [SL-1605] [Bug] No validation that a param is requested
- [SL-1611] [Feature] Enable querying time offset metrics with their agg_time_dimension
- [SL-1617] [Feature] Enable time constraints with `agg_time_dimension` instead of `metric_time` HOT 2
- [SL-1619] [Feature] Allow measures that join to time spine to use `agg_time_dimension`
- [SL-1627] Add full support for predicate pushdown, including partition pruning
- [SL-1628] Update dataflow plan to push predicates down to semantic model source queries where possible
- [SL-1629] Enable support for predicate pushdown for queries involving time range adjustments (e.g., offsets, cumulative)
- [SL-1630] Enable automatic time range adjustments for standard sets of time filter predicates
- [SL-1631] Ensure predicate rendering is compatible with partition pruning directives across relevant engines
- [SL-1633] [Feature] Support metric/measure filters
- [SL-1634] [Feature] Support Dimension-only queries for SCD dimensions HOT 2
- [SL-1642] [Feature] Add Support for Consistent SQL Query Generation
- [SL-1704] [SL-1703] [Feature] Enable `fill_nulls_with` and `join_to_timespine` on metric spec
- [SL-1711] [Feature] Support resolution of time dimension grain when using Dimension() object syntax HOT 2
- [SL-1720] [Feature] Remove SQL-Comment-Based Tags
- [SL-1721] [Feature] Consistent SQL Generation HOT 1
- [SL-1725] [Feature] Reference a measure from another semantic model.
- [SL-1570] [SL-1571] [Feature] Allow Partial Entity Paths in Group-By-Items
- [SL-1557] Only require agg_time_dimension if there are TIME dimensions in the semantic model HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metricflow.