betodealmeida commented on code in PR #15241:
URL: https://github.com/apache/superset/pull/15241#discussion_r876137086
##########
docs/docs/installation/sql-templating.mdx:
##########
@@ -273,3 +273,27 @@ Here's a concrete example:
superiors
order by lineage, level
```
+
+**Datasets**
+
+It's possible to query physical and virtual datasets using the `dataset`
macro. This is useful if you've defined computed columns and metrics on your
datasets, and want to reuse the definition in adhoc SQL Lab queries.
+
+To use the macro, first you need to find the ID of the dataset. This can be
done by going to the view showing all the datasets, hovering over the dataset
you're interested in, and looking at its URL. For example, if the URL for a
dataset is https://superset.example.org/superset/explore/table/42/ its ID is 42.
+
+Once you have the ID you can query it as if it were a table:
+
+```
+SELECT * FROM {{ dataset(42) }} LIMIT 10
+```
+
+IF you want to select the metric definitions as well, in addition to the
columns, you need to pass an additional keyword argument:
Review Comment:
```suggestion
If you want to select the metric definitions as well, in addition to the
columns, you need to pass an additional keyword argument:
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]