Natural language query

Last modified by Aurelie Bertrand on 2026/06/29 11:14


Natural language queries enable users to explore data by converting a query into a graphical visualisation. This allows users to interact with the data without any specialist knowledge.

Prerequisites

Cubes in your recently refreshed portfolios.

Creating charts using natural language queries

Natural language queries can be run from the dashboard editor or directly within the dashboard. They are based on the data models of the currently selected role.

From the dashboard editor

In the dashboard editor, you can add a chart created using a natural language query to the dashboard.

  1. Open the Dashboard Editor and select the dashboard page to which you wish to add a chart.
  2. In the left-hand side panel, click ‘Create new charts’ and tick the ‘Natural language’ option.
    Natural_language_panel_FR.png
  3. Then enter your query in the search bar.
    See the section Formulating a natural language query for further details.
    ➡ A list of charts is displayed, sorted by relevance.
    See the section Query results for further details.
    Exemple requête
  4. Click on the chart of your choice.
    ➡ The ‘Create a new chart ’ box appears with a preview of the chart.
    Création nouveau graphique
  5. Rename the chart if necessary and click on Add chart.
    ➡ The new chart is added to the selected dashboard and to the list of Information Flows (Existing charts).

From the dashboard

It is also possible to add an additional content element – ‘Data Query’ – to your final dashboard so that you can create new charts directly within the dashboard.

  1. Open the Dashboard Editor and select the dashboard page to which you wish to add the query box.
  2. In the left-hand side panel, click on ‘Additional Content’ to display the list of elements.
  3. Drag and drop the ‘Data Query’ element onto the dashboard page.

💡 You may find that, when running queries, you filter by members of a dimension or measure. It is therefore advisable to add the ‘Filtered Items’element to the dashboard so that you can remove them for future queries.

  1. Save and view the dashboard.
    ➡ You can enter a query in the search bar of the ‘Data Query’ box. See the section Formulating a query in natural language for further details.
    ➡ The results are displayed with a score indicating their relevance. See the section Query results for further details.
    ​​​​​​​1738662183414-447.png
  2. Click on the desired chart to view a preview.
    ​​​​​​​Aperçu du flux
  3. You can save it by clicking the 1705681243815-758.png and then Save.
    Rename it if necessary and click OK.
    ➡ It is added to the Flow portfolio.

Formulating a natural language query

Natural language queries rely primarily on keywords to suggest the most relevant charts, as well as on the column names in the data models.

A query will therefore basically consist of measure names from your model and/or dimension names, followed or not by chart types and/or sorting operations.

We will see later in this document just how important the choice of terms in a query is.

Chart type

For a given query, you will be presented with a list of results comprising various charts, depending on the content of the query.

However, it is possible to specify a particular chart type, provided that the query remains coherent (the query “Communication costs as a line chart” is not coherent).

The number of entries in the query results also has an impact. Indeed, in the case of a coherent query but with too many results, you will be offered a chart suited to the number of results to be displayed.

Here are the keywords to use in the query when selecting charts:

Chart namesKeywords
Pie chart‘sector’
 ‘pie chart’
 ‘ratio’
Gauge‘gauge’
Progress bar‘progress bar’
Energy bars

‘energy’

‘consumption’

Arrow indicator‘arrow’
Bar chart

‘bar’

‘histogram’

Bar chart‘bar’
Map‘map’
Scatter plot

‘scatter’

‘correlation’

Bubble chart‘bubble’
Line chart

‘line’

‘curve’

Area chart

‘area’

‘area’

Radar chart‘radar’
Table

‘table’

‘table’

Indicator‘indicator’
Cross table‘Cross table’
Text‘text’

Sort

You can sort your search results using the following keywords:

SortKeywordsQuery examples
Ascending

‘sort’ (ascending)

“sorted” (ascending)

‘sorts’ (ascending)

‘sorted’ (ascending)

‘sort’ (ascending)

‘order’ (ascending)

‘ascending’

‘Costs by region in France in 2006, sorted by cost in a table’

‘Costs by region in France in 2006, sorted in a table’

‘Costs by region in France in 2006, in ascending order in a table’

‘Costs by region in France in 2006, sorted in ascending order in a table’

Descending

‘sorted’ (descending)

“sorted” (descending)

“sorts” (descending)

“arranged” (descending)

‘sort’ (descending)

‘order’ (descending)

‘descending’

‘Costs by region in France in 2006, sorted in descending order by cost in a table’

“Costs by region in France in 2006, in descending order in a table”

‘Costs by region in 2006 sorted in descending order in a table’

Trend of a metric

A metric has a trend. It can be stable (default trend), increasing or decreasing:

TrendMeaning
StableDefault trend: The higher, the better
Increasing

The larger, the better

Example: for a margin

Decreasing

The smaller, the better

Example: for a cost

You can edit a metric’s trend via Digdash Studio, in the advanced configuration of a data source, within the metric’s properties. See the section Editing the metric’s trend for further details.

Impact of the trend on sorting

The trend affects sorting. If the sort order (ascending or descending) is not explicitly specified, it will be based on the trend of the metric being sorted. Consequently, a measure with a stable or rising trend will be sorted in descending order, whilst a measure with a falling trend will be sorted in ascending order.

TrendExamples of queriesSort order obtained
Stable

‘Revenue by region, sorted’

Turnover is a metric with a stable trend

The ‘Revenue’ measure will be sorted in descending order by the ‘Region’ dimension
Ascending

“Sort by region: Margin”

Margin is a measure with an increasing trend

The ‘Margin’ measure will be sorted in descending order by region
Descending

‘Cost by region, sorted’

Cost is a measure with a decreasing trend

Sorting the ‘Cost’ measure by the ‘Region’ dimension will be in ascending order

Worst / Best

You can identify the top X best/worst members from your query results using the following keywords:

CasesKeywordsExample
The X best

‘Top’

‘best’

‘biggest’

‘most important’

The best value for money in France

The 5 best profit margins in 2016

The 2 highest turnover figures in Europe

Top 3 costs in France in 2016

The X worst

‘Worst’

“not as good”

“worse”

‘smaller’

The worst cost in France

The 5 worst profit margins in 2016

The 2 worst turnover figures in Europe

Aggregation method

You can define an aggregation function for the metrics in your query by specifying the following keywords:

AggregationKeywordsQuery examples
Sum‘sum’“Total communication costs”
Average‘average’‘Average communication cost’
Minimum‘min’‘Minimum communication cost’
Maximum‘max’“Max communication cost”

Target

You can apply targets to metrics by including the following keyword in the query:

Keywords
“objective”

You can also specify the names of the objectives you wish to apply directly.

Example

Consider a data model with the following columns

DimensionsMeasures
DateCommunication quality
Line typeCommunication cost (with ‘Obj’ target)
  • Example 1: ‘Communication cost in gauge with target’
    ➡ All targets for all measurements are applied (one target per measurement).
  • Example 2: ‘Communication cost in gauge with Obj’
    ➡ The ‘Obj’ target is applied to the associated measure ‘Communication cost’.

Using synonyms

Natural language search supports synonyms for the terms in your queries.

You can enter synonyms or import them from a dictionary. See the page Using synonyms for further details.

Enabling synonym dictionaries

You must then ensure that the use of synonym dictionaries is enabled for the Natural Language Query feature in the server configuration.
From the home menu, go to Configuration -> Server Settings -> Dictionaries & Languages -> Synonym Dictionariesand tick the box labelled ‘Use synonym dictionaries for natural language queries’.

Activate_synonym_dictionary_FR.png

Example of use

Consider a data model with the following columns

DimensionsMeasures
DateCommunication quality
Line typeCall charges

In this case:
The query“Call charges by line type”is equivalent to the query“Call costs by line type”
(“prix” is a synonym for “coût” and “genre” is a synonym for “type”).

❗This only applies if your thesaurus contains these synonyms.

Query results

Requête_direct_TDB2.png

The results of a query provide a list of charts ranked by relevance, with an associated score out of 5. The higher the score, the more relevant the associated chart is considered to be. The name of the associated data model is shown, along with a description of the chart.

  • Query terms

A query result will be ranked higher if the query terms contain the exact names of the columns in your data models.

A query will therefore be considered less effective if its terms contain partial names of your columns, or synonyms for the column names in your data model.

Example
Consider a data model with the following columns
DimensionsMeasures
DateCommunication quality
Line typeCall cost

Request 1:

With exact names

Query 2:

With partial names

Query 3:

With synonyms

‘Communication costs by line type’“Cost by type”“Price by line type”
If only exact terms are used in this query, the results may be well-ranked.If partial terms are used in this query, the results may be of lower quality.

‘price’ is synonymous with ‘cost’, ‘line category’ is synonymous with ‘line type’.

This query differs from the original query; the scores will be low.

Score*: 5/5Score*: 3/5Score*: 2/5
* The scores shown are for illustrative purposes only in this document
  • Type of chart suggested

The list of results for a query includes charts that are more or less relevant to what is expected. Given the nature of the search terms, some charts will be ranked lower than others, resulting in a lower score for the latter.