Using the query builder

Blank 20/9/2021 04:26 - 20/9/2021 04:26
Integrations

A query can be a request for results, or for action, from the data in your database. It can be used to give you an answer to a simple question, combine data from different locations, and much more.

Kademi's query builder is a great way for non-developers to create queries, which may be useful for a range of reasons.

In this example, we will create a query which returns sales records from a particular data series with an amount greater than 10.

1 To create a query, go to Data, then Search Indexes.

2 Click through to the index to create the query for.

In this example, we want to create a query related to sales data, so we will select the dataSeries index.

3 Click Create Query.
4 Enter a meaningful name for the query, then click OK.

The name should not include any spaces or special characters.

 

5 Click through to Data, then Queries, and select the query you created.

We will be creating a query to filter the data in the dataSeries index. This filter will use 2 rules:

  • Sales must be from the Actual Sales data series
  • AND
  • Sales records must be greater than 10

6 To create a rule, click Add rule, then select the field to filter the query by.

7 To return sales from the Actual Sales data series, select the dataSeriesName filter, set it to be equal, and enter the ID of the relevant data series.
8 To only include results greater than 10, click Add rule and set the condition to AND, select the amount filter, set it to be greater, and enter the value that sales must be greater than to be included, i.e. 10.
9 Select how to sort the results of the query, which in this case will be ascending (ASC), by the amount of the record, then Save the query.
10 On the Results tab, click Select fields.
11 Click the + icon next to the fields that should be displayed with the results of the query, then click Save.

This will return the results of the query, sorted by the order selected earlier.

12 Click Export to download the results of the query, which will use the same format.

Watch the video below to see these steps in action.