An introduction to IQL
InfoSum’s Insight Query Language (IQL) provides the ability to analyse connected data. Loosely based on SQL, IQL enables you to join, filter and enrich any number of datasets.
This article will describe the core capabilities of the language and the structure of a query. The following articles will then break down the different clauses and explain how to write queries in IQL.
There are three main components to any query - specifying the type of query, the categories to be used and the intended audience - and three optional tools - applying filters to the intended audience and enriching or linking identities with additional datasets.
IQL supports two types of queries with different outputs. An insight query returns statistical result founded on aggregated data, whereas an identity query returns a list of identifiers that relate to specific individuals. The query type is defined alongside with defining the categories you intend to use and how you would like the results to be displayed.
You will only be able to run an identity query on identity datasets owned by you or those which you have permission to use in this way. For more information on permissions, see permission levels.
The intended audience is then defined by referencing published datasets and specifying the relationships, for example by using operators to define the union, intersection or exclusion of 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.
There are then several additional clauses available to help you achieve your objective:
- Apply any number of integer or string filters, such as to only include females over 30 and have an income of £40,000 or more, or anyone who lives in Dorset or is interested in sailing.
- Enrich your analysis by using categories held in additional datasets, such as by including demographic categories held within a separate dataset that you have permission to query.
- Reference another dataset to link identities across datasets, for example by using a glue dataset to find out which individuals appear in two datasets that hold different customer identifiers.
The structure of a query
A query in IQL always references one or more datasets, using its Private ID. A dataset is roughly analogous to a table in a conventional database system. You can use a dataset in an IQL query if you are its owner, or if you have a permission to reference it.
An IQL query compromises of several parts:
SELECTclause, which specifies the query type and the categories to be used
FROMclause, which defines which datasets will be used to create the audience
- an optional
WHEREclause, which applies a filter to the records included
- an optional
ENRICH WITHclause, which includes categories from other datasets
- an optional
LINK WITHclause, which uses glue datasets to link identities
The following articles describe these clauses in more detail.