Audience definition
The FROM clause 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.
In the 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:
FROM mydatasetSo, it would look something like this:
SELECT COUNT()
FROM mydatasetBuild 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:
Union
FROM A Union BIntersection
FROM A Intersect BExclude
FROM A Exclude BYou can also use multiple operators at once, for example:
FROM (A Union B) Exclude CFROM 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.
Next steps
After the SELECT and FROM clauses, there are three optional clauses available:
- the WHERE clause, which applies a filter to the records included
- the ENRICH WITH clause, which includes categories from other Datasets
- the LINK WITH clause, which uses a bridge Datasets to link keys