Skip to content

Example queries #77

@yoid2000

Description

@yoid2000

If we don't have example queries that the user can use as a template for his/her own queries, then users won't know how to use the system.

I'd like to have a set of example queries created whenever a user adds a table. There should be enough queries that a user can most likely find a query that more-or-less does what the user wants to do, but not so many that the user can't find an appropriate query even when it exists. The example queries should do the following:

  1. Cover most of the functions that we provide.
  2. Provide enough templates so that usually a user only needs to find a template, change the column / aggregation values, and move forward.

It would be super useful if this process resulted in the initial page of Metabase showing a few of these queries under the heading "Pick up where you left off" (rather than the normal original page to explore data, which fails if the data is anonymized). Not sure if that is possible, since the page is populated with examples of previous queries that the user wrote.

One source of example queries are the queries at training.open-diffix.org.

I don't think we need to necessarily provide queries that are directly useful to the user. This would be hard to do in any event. I think more important is that we provide examples, and that the user can look through a reasonable list of query titles and pick out the most appropriate template, and then just make small changes to it.

Then the changed query can be saved as a new query:

image

In Metabase, we could have one "Collection" per table. Each collection then has a number of sample queries and associated visualizations, and maybe one dashboard containing the examples. Each per-table collection can be a sub-folder in an "Examples" folder, like this:

image

I think we could have for instance the following examples:

  • Count distinct column
  • Count rows (histogram, 2 columns)
  • Count protected entities (histogram, 1 column)
  • Sum column and average column in same query
  • Numeric generalization (use a column with many distinct numeric values)
  • Datetime generalization
  • Substring (perhaps together in one query with numeric generalization)
  • WHERE clause
  • A query with substantial suppression (if we can find a column with man distinct numeric values)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions