Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5a703ed

Browse files
authored
docs: amend parameters use list + sql_from (#121)
* docs: amend parameters use list + sql_from * docs: joins reference * docs: add links to all use cases
1 parent de0c4a0 commit 5a703ed

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

‎guides/using-parameters.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@ For example, you might define a `region` parameter that users can set to filter
2929

3030
Parameters can be referenced in many places throughout your Lightdash project:
3131

32-
1. **Dimension SQL**: Use parameters in the SQL definition of a dimension
33-
2. **Metric SQL**: Use parameters in the SQL definition of a metric
34-
3. **Table SQL**: Use parameters in the SQL definition of a table
35-
4. **Table SQL_ON**: Use parameters in the SQL_ON clause of a table join
36-
5. **Table Join**: Use parameters in join conditions
37-
6. **SQL Runner**: Use parameters in custom SQL queries
38-
7. **Table Calculations**: Use parameters in table calculations
39-
8. **Additional Dimensions**: Use parameters in the SQL definition of an additional dimension
40-
9. **Custom Dimensions**: Use parameters in custom dimension definitions
32+
1. **Dimension SQL**: Use parameters in the SQL definition of a [dimension](/references/dimensions)
33+
2. **Metric SQL**: Use parameters in the SQL definition of a [metric](/references/metrics)
34+
3. **Table SQL**: Use parameters in [sql_from](/references/tables#sql-from) and [sql_filter](/references/tables#sql-filter-row-level-security) definitions
35+
4. **Table Joins**: Use parameters in [join](/references/joins) conditions
36+
5. **SQL Runner**: Use parameters in the [SQL Runner](/references/sql-runner) query
37+
6. **Table Calculations**: Use parameters in [table calculations](/references/table-calculations)
38+
7. **Additional Dimensions**: Use parameters in the SQL definition of an [additional dimension](/references/dimensions#additional-dimensions)
39+
8. **Custom Dimensions**: Use parameters in [custom dimension](/references/custom-fields#custom-sql) definitions
4140

4241
## How to reference parameters in SQL
4342

‎references/tables.mdx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ models:
6464
| [joins](/references/joins) | array | Join logic to join other data models to the Table. [Read about joins.](/references/joins) |
6565
| [metrics](/references/metrics#2-using-the-model-meta-tag) | object | Model metrics. [Read about model metrics](/references/metrics#2-using-the-model-meta-tag) |
6666
| [group_label](#group-label) | string | Group tables in the sidebar. [Read about the group label.](#group-label) |
67-
| [sql_filter](#sql-filter) | string | A permanent filter that will always be applied when querying this table directly. [Read about `sql_filter`.](#sql-filter) |
68-
| [sql_where](#sql-filter) | string | Alias for `sql_filter` |
67+
| [sql_from](#sql-from) | string | Overrides dbt model relation_name |
68+
| [sql_filter](#sql-filter-row-level-security) | string | A permanent filter that will always be applied when querying this table directly. [Read about `sql_filter`.](#sql-filter) |
69+
| [sql_where](#sql-filter-row-level-security) | string | Alias for `sql_filter` |
6970
| [required_attributes](#required-attributes) | object | Limits access to users with those attributes. [Read about user attributes](/references/user-attributes) |
7071
| group_details | object | Describes the groups for dimensions and metrics |
7172
| [default_filters](#default-filters) | array | Dimension filters that will be applied when no other filter on those dimension exists. [Read about `default_filters`](#default-filters) |
@@ -131,6 +132,18 @@ The tables in your sidebar will appear in the following order:
131132
![](/images/references/table-group-label-a6d42e6d72a08f15c392fb7cb03a2e6a.png)
132133
</Frame>
133134

135+
### SQL from
136+
137+
`sql_from` is a configuration option that **overrides the default dbt model relation name** when generating SQL queries in Lightdash.
138+
139+
For example, you might use this if you want your Lightdash explore to query from a specific materialized view, a different schema, or include additional SQL logic in the FROM clause while still maintaining the dbt model structure for dimensions and metrics.
140+
141+
```yaml
142+
models:
143+
- name: sales
144+
meta:
145+
sql_from: my_schema.my_sales_view
146+
```
134147

135148
### SQL filter (row-level security)
136149

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /