Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sl-partner-integration-guide.md #4836

Merged
merged 8 commits into from
Feb 5, 2024
4 changes: 1 addition & 3 deletions website/docs/docs/build/saved-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,4 @@ saved_queries:
- "{{ Dimension('listing__capacity_latest') }} > 3"
```

### FAQs

* All metrics in a saved query need to use the same dimensions in the `group_by` or `where` clauses.
All metrics in a saved query need to use the same dimensions in the `group_by` or `where` clauses.
19 changes: 13 additions & 6 deletions website/docs/guides/sl-partner-integration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Best practices for exposing metrics are summarized into five themes:

- [Governance](#governance-and-traceability) — Recommendations on how to establish guardrails for governed data work.
- [Discoverability](#discoverability) — Recommendations on how to make user-friendly data interactions.
- [Organization](#organization) — Organize metrics and dimensions for all audiences.
- [Organization](#organization) — Organize metrics and dimensions for all audiences, use [saved queries](/docs/build/saved-queries).
- [Query flexibility](#query-flexibility) — Allow users to query either one metric alone without dimensions or multiple metrics with dimensions.
- [Context and interpretation](#context-and-interpretation) — Contextualize metrics for better analysis; expose definitions, metadata, lineage, and freshness.

Expand All @@ -73,23 +73,25 @@ When working with more governed data, it's essential to establish clear guardrai

- Consider treating [metrics](/docs/build/metrics-overview) as first-class objects rather than measures. Metrics offer a higher-level and more contextual way to interact with data, reducing the burden on end-users to manually aggregate data.

- Easy metric interactions: Provide users with an intuitive approach to:
- **Easy metric interactions** — Provide users with an intuitive approach to:
* Search for Metrics — Users should be able to easily search and find relevant metrics. Metrics can serve as the starting point to lead users into exploring dimensions.
* Search for Dimensions — Users should be able to query metrics with associated dimensions, allowing them to gain deeper insights into the data.
* Filter by Dimension Values — Expose and enable users to filter metrics based on dimension values, encouraging data analysis and exploration.
* Filter additional metadata — Allow users to filter metrics based on other available metadata, such as metric type and default time granularity.

- Suggested Metrics: Ideally, the system should intelligently suggest relevant metrics to users based on their team's activities. This approach encourages user exposure, facilitates learning, and supports collaboration among team members.
- **Suggested metrics** — Ideally, the system should intelligently suggest relevant metrics to users based on their team's activities. This approach encourages user exposure, facilitates learning, and supports collaboration among team members.

By implementing these recommendations, the data interaction process becomes more user-friendly, empowering users to gain valuable insights without the need for extensive data manipulation.

### Organization

We recommend organizing metrics and dimensions in ways that a non-technical user can understand the data model, without needing much context:

- **Organizing Dimensions** &mdash; To help non-technical users understand the data model better, we recommend organizing dimensions based on the entity they originated from. For example, consider dimensions like `user__country` and `product__category`.<br /><br /> You can create groups by extracting `user` and `product` and then nest the respective dimensions under each group. This way, dimensions align with the entity or semantic model they belong to and make them more user-friendly and accessible.
- **Organizing dimensions** &mdash; To help non-technical users understand the data model better, we recommend organizing dimensions based on the entity they originated from. For example, consider dimensions like `user__country` and `product__category`.<br /><br /> You can create groups by extracting `user` and `product` and then nest the respective dimensions under each group. This way, dimensions align with the entity or semantic model they belong to and make them more user-friendly and accessible.

- **Organizing Metrics** &mdash; The goal is to organize metrics into a hierarchy in our configurations, instead of presenting them in a long list.<br /><br /> This hierarchy helps you organize metrics based on specific criteria, such as business unit or team. By providing this structured organization, users can find and navigate metrics more efficiently, enhancing their overall data analysis experience.
- **Organizing metrics** &mdash; The goal is to organize metrics into a hierarchy in our configurations, instead of presenting them in a long list.<br /><br /> This hierarchy helps you organize metrics based on specific criteria, such as business unit or team. By providing this structured organization, users can find and navigate metrics more efficiently, enhancing their overall data analysis experience.

- **Using Saved queries** &mdash; The dbt Semantic Layer has a concept of [saved queries](/docs/build/saved-queries) which allows users to pre-build slices of metrics, dimensions, filters to be easily accessed. You should surface these as first class objects in your integration. Refer to the [JDBC](/docs/dbt-cloud-apis/sl-jdbc) and [GraphQL](/docs/dbt-cloud-apis/sl-graphql) APIs for syntax.

### Query flexibility

Expand All @@ -102,7 +104,11 @@ Allow users to query either one metric alone without dimensions or multiple metr
- Only expose time granularities (monthly, daily, yearly) that match the available metrics.
* For example, if a dbt model and its resulting semantic model have a monthly granularity, make sure querying data with a 'daily' granularity isn't available to the user. Our APIs have functionality that will help you surface the correct granularities

- We recommend that time granularity is treated as a general time dimension-specific concept and that it can be applied to more than just the primary aggregation (or `metric_time`). Consider a situation where a user wants to look at `sales` over time by `customer signup month`; in this situation, having the ability to apply granularities to both time dimensions is crucial. Our APIs include information to fetch the granularities for the primary (metric_time) dimensions, as well as all time dimensions. You can treat each time dimension and granularity selection independently in your application. Note: Initially, as a starting point, it makes sense to only support `metric_time` or the primary time dimension, but we recommend expanding that as your solution evolves.
- We recommend that time granularity is treated as a general time dimension-specific concept and that it can be applied to more than just the primary aggregation (or `metric_time`).

Consider a situation where a user wants to look at `sales` over time by `customer signup month`; in this situation, having the ability to apply granularities to both time dimensions is crucial. Our APIs include information to fetch the granularities for the primary (metric_time) dimensions, as well as all time dimensions.

You can treat each time dimension and granularity selection independently in your application. Note: Initially, as a starting point, it makes sense to only support `metric_time` or the primary time dimension, but we recommend expanding that as your solution evolves.

- You should allow users to filter on date ranges and expose a calendar and nice presets for filtering these.
* For example, last 30 days, last week, and so on.
Expand Down Expand Up @@ -142,6 +148,7 @@ These are recommendations on how to evolve a Semantic Layer integration and not
* Listing available dimensions based on one or many metrics
* Querying defined metric values on their own or grouping by available dimensions
* Display metadata from [Discovery API](/docs/dbt-cloud-apis/discovery-api) and other context
* Use [saved queries](/docs/build/saved-queries) to query pre-build metrics, dimensions, and filters. Refer to the [JDBC](/docs/dbt-cloud-apis/sl-jdbc) and [GraphQL](/docs/dbt-cloud-apis/sl-graphql) APIs for syntax.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rpourzand also added this here as integration recommendations - do you think it makes sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah looks great! I might tweak it slightly to read like

"Expose "Saved Queries" which are pre-built metrics, dimensions, and filters that Semantic Layer developers create for easier analysis. You can expose them in your application - refer to the JDBC and GraphQL APIs..."

mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved

**Stage 3 - More querying flexibility and better user experience (UX)**
* More advanced filtering
Expand Down
Loading