As noted in the select query type article, the
FROM clause is the second mandatory part of any query. It defines the intended audience, which can be as simple as specifying the dataset or using operators to build relationships between multiple datasets.
Specifying an audience in this way allows our platform to understand what you are trying to achieve, so any loss of quality in the results caused by poor information or overlaps can be highlighted. Please see the quality metrics article for an in-depth explanation of query quality.
SELECT clause article, insight and activation queries were discussed separately, as the syntax is differently for the
SELECT clause. For every other clause, the syntax is the same.
Reference a published dataset
To specify the dataset, after the
SELECT clause, simply write:
So, it would look something like this:
Build relationships with operators
If you want to, you can select the union, intersection or exclusion of datasets by using operators. The diagram below shows how they can be used to define an exact audience.
To use the operators, write something like this:
FROM A Union B
FROM A Intersect B
FROM A Exclude B
You can also use multiple operators at once, for example:
FROM (A Union B) Exclude C
FROM A Intersect (B Exclude C)
The operators are evaluated from left to right, except when parentheses are used which can be used to change the order.
FROM clauses, there are three optional clauses available: