Querying Your Data with Simply Ask (NLQ)

Simply Ask is Sisense's Natural Language Query (NLQ) feature. It enables you to ask sophisticated questions using natural language and immediately receive visualizations that provide you with the answers.

As you enter your questions, Sisense provides automatic suggestions to help you build your query. These suggestions are recommended by Sisense's proprietary Knowledge Graph , which studies the associations between all entities on the system (users, data, models, widgets, formulas, clicks, filters, and more) to understand the collective wisdom of the organization. This leads to more "human" and context-aware outcomes from the Sisense AI engine.

Simply Ask offers an easy way for anyone, regardless of their role, to get insights from their data.

Enabling Simply Ask

To enable Simply Ask for your system:

Your Sisense Administrator must activate Simply Ask on the system level.

  1. From the Admin tab, search for and select Feature Management, which is located under App Configuration.

  2. In the AI section, toggle on Simply ask (NLQ).

  3. Click Save in the bottom right-hand corner of the screen.

Note:

Simply Ask is enabled on the system level. It does not consume resources unless Simply Ask is enabled for a dashboard.

To add Simply Ask to a dashboard:

As a dashboard designer, you may enable Simply Ask on any dashboard.

Open the dashboard menu and select Simply Ask (NLQ) > Enable Simply Ask.

The Dashboard Designer can access Simply Ask, where they can ask questions and view the visualizations. This provides an opportunity for the designer to test the experience before exposing it to Viewers.

Dashboard viewer access to Simply Ask:

When the Designer republishes the dashboard and shares it with Viewers, the Viewers will also see the Simply Ask button and will be able to ask questions.

Note:

By default, dashboard filters are enabled for Simply Ask queries. Simply Ask inherits the dashboard filters (respective to the dashboard Simply Ask is invoked from), such that the question being asked in Simply Ask implicitly applies the dashboard filters in the background. This ensures that the numbers that appear in Simply Ask match those that are in the underlying dashboard. If you do not want your Simply Ask queries to inherit the dashboard filters, open the dashboard menu and select Simply Ask (NLQ) > Disable Filters.

The Natural Language Query (NLQ) Model

Simply Ask (NLQ) runs on an NLQ model that specifies all columns and formulas that are available for querying via Simply Ask.

NLQ Model Creation

The NLQ model is created per dashboard when you enable Simply Ask on that dashboard. For an empty dashboard, before it is published, the full set of columns from the data model will be available. Once the dashboard is published, the NLQ model will include all the formulas, fields, and filtered fields that already appear in the dashboard. The NLQ model is updated every time the dashboard is published.

Custom NLQ Model Creation

The NLQ model can be further customized only through API. Any changes to the model will override the default behavior of resetting the NLQ model during dashboard publishing. For more information, see the NLQ API section below.

NLQ Model Updates

The NLQ model will automatically be updated in the following scenarios:

  • When a dashboard is republished, the existing NLQ model will be overwritten with the up to date formulas, fields, and filtered fields in the dashboard.

  • ElastiCube Build - The NLQ model will be updated according to Schema changes.
    Note that if you haven't modified the dashboard to accommodate the schema changes, the model may still refer to missing components.

  • Live model publish - The NLQ model will be updated according to Schema changes.
    Note that if you haven't modified the dashboard to accommodate the schema changes, the model may still refer to missing components.

  • REST API [v1.0 PATCH /nlq/{id} ] - Update via API to any custom NLQ model.

Asking Questions

Enter your question in the Ask a question about your data field, or select one of the predefined questions. These predefined questions are generated by the Sisense knowledge-graph, based on you and your organization's experience.

When you ask a question in natural language, Sisense automatically translates it into a formal query and displays it below the input field. In this example, "What is my total revenue" is translated to the formal query "Total Revenue (measure)".

When your question is ready, click Run or press Enter and Sisense displays its recommended visualization with your data.

If you want to choose another visualization, you can select one from the right side. You can choose from any of the visualizations that support your data.

Suggestions

Start typing your question and Sisense will provide knowledge graph-based suggestions based on the fields in your data. You can click these suggestions to add them to your question. While you type, Sisense provides the following real-time assistance:

  • Automatic Suggestions for the Next Word - The system provides suggestions for filters and break-bys. For example, the system suggests the time break-by categories, such as "by week", "by day".
  • Spellcheck - When you mistype or misspell a word, the system underlines it with a red line. Click the word to get a list of suggested correct spellings or click Ignore . If you do not do anything, the system will apply the first suggested correction.
  • Ambiguity Resolution - When the word you entered might be associated with more than one column or value, the system underlines it with a blue line. Click the word for a list of possible columns or members and select the correct one.
  • Word Auto-Complete - When you enter words, the system brings up suggestions for the word, which enables you to complete the query faster.
  • Synonym Translation - When you enter a word that is not part of the data model, the NLQ engine, which comes bundled with an English dictionary of synonyms and the words in your model, automatically translates this query into a synonym that does exist in the data model (for example, income / revenue, or nation / country) and returns the correct result. Of course, if you use specific terminology that's not a direct synonym in the English dictionary, you can add it as a synonym to the model (see Adding Aliases).
  • Synonyms - Simply Ask leverages an advanced AI language Model to automatically support synonyms from the English Dictionary without configuring this in advance. Sisense automatically detects synonyms for words that you use in your natural language query. For example, if you search for "Sales by Region", and the data model doesn't have a region field, it will automatically match the word "region" with "country", a field that does exist in the NLQ model.

Available Fields

If you are not familiar with the data, you can display a list of all the fields and formulas you can ask questions about. You can either enter the field name manually, or click fields to add them to your question.
In the example, below, you can now see that you can ask questions about quantity, age range, revenue, and so on.

Forecasting

If Forecast is enabled (see Forecasting Future Results), you can use keywords such as "next" or "forecast" and a time range to return a forecast for your data. For example, you can ask "What is my revenue in the next 6 weeks?" to add a forecast to any Cartesian widget. Another way to ask the same question is "Forecast my revenue for the next 6 weeks".

Note:

If you use the word "next" without specifically using the word "forecast", Sisense will mark the word with a blue line (ambiguity), and auto-suggest two possible interpretations to this question: one is to apply forecast (calculate future results), and the other is to apply the "next" filter (display the next time periods within the existing historical data).


Keywords

  • Next, Forecast

Limitations

  • Only Cartesian models
  • Must have at least 30 data points
    • Live models are restricted to the row limit for live queries

Adding Trend Lines with NLQ

You can leverage Simply Ask to add trend lines and apply advanced analytic models to a widget. For example, you can ask questions like "What is the trend of my revenue in 2020".

Keywords

  • Trend

Limitations

  • Only Cartesian models

Sample Questions

Simply Ask is a powerful natural language querying tool that leverages advanced semantic understanding to interact with your data. Unlike traditional systems based on templates and reserved keywords, Simply Ask interprets the meaning of your sentences, providing a more intuitive and flexible user experience. Below are explanations and examples of how to apply various data operations using Simply Ask.

Applying Aggregation Functions and Formulas to Your Queries

Example Terms

Query Example

Create a Measure by applying an aggregation function to a field.

  • Sum / Total

  • Count all

  • Count unique

  • Min

  • Max

  • Average

  • Median

Total sales by months

Minimum deal size 2019

Average revenue

Grouping the Data by a Category

Example Terms

Query Example

Group the data by another distinct category. 

  • Break by

  • By

  • Per

  • For each

Sum sales break by product

Total Revenue by  gender

Group the data into date segments by defining the date level aggregation. 

  • By days / weeks / months / quarters / years

  • Daily / weekly / monthly / quarterly / yearly

Total Revenue by months

Total Revenue monthly

Monthly total revenue

Applying Filters

Example Terms Query Example

Filter on Dates

Note:

If you have more than one date field in the data model, specify on which field to apply the filter.

  • Filter data by date by specifying the date period. 

  • This day / this week / this month / this quarter / this year

  • Last / past day / week / month / quarter / year

  • Today / yesterday / tomorrow

  • Last / past X day / week / month / quarter / year

  • X day / week / month / quarter / year ago

  • Next day / week / month / quarter / year

  • Next X day / week / month / quarter / year / tomorrow

  • Starting / from date

  • Until / till / to date

Revenue last 2 weeks

What is my Revenue Today

Filter by common holidays and public events such as ‘last Christmas’. The event will be translated to a date filter.

How much money did I make last Black Friday

Filter on Text

Contains Filters: Filter your data according to a filter condition on the text.

  • Starts with

  • Ends with

  • Containing

  • Equals

  • Doesn't Start With

  • Doesn't End With

  • Doesn't Contain

  • Doesn't Equal

Total revenue where category starts with 'table'

Total revenue where category doesn't start with 'table'

Total revenue for countries containing 'e'

Total revenue for countries ends with ‘e’

Note:

You can either add an apostrophe (‘) or quotes (“) or reference the string without them.

Value (Member) Filters: Single-select and multi-select filtering of specific values (members).

Example Terms: is, in, and, “,”, of

Sum revenue where category is 'monitors'

Total sales of category routers

Total revenue for countries in (Spain, France)

Sum sales by products for Product A, Product B and Product C

Top/Bottom Ranking Filter

This filter enables you to include only the fields that rank at the top or bottom, facilitating focused analysis.

  • Top / highest

  • Bottom/ lowest

The top 5 countries with the highest income

What is the country with the lowest  income

Sorting the Results Set

Example Terms

Query Example

Data can be organized in ascending or descending order, enhancing the clarity and utility of the information presented.

  • Sort, sort by (default is descending)

  • Sort ascend / sort ascending / sort ascendingly

  • Sort descend / sort descending / sort descendingly

Sum sales sorted by sales DESC break by category

Revenue by country sort ascending 

Saving Your Query for Later

After you have run your query, several additional options are displayed that allow you to save your query for later.


Adding the Widget to the Dashboard

Dashboard designers have an option to pin the current Simply Ask widget to the dashboard as a widget, where it can be further edited.

Disabling/Enabling Simply Ask for a Data Model

Simply Ask, is enabled by default, from the Data Model level. If you wish to disable it for a given data model, you can. This will block the dashboard designers from being able to turn it on from the related dashboards and it will disable any existing NLQ model that was configured for the related Dashboards.

In the Data page, open the menu of each data model you want to disable Sisense Simply Ask for and select Disable Simply Ask (NLQ) .

Note:

For users that started using Simply Ask before version L2023.2, the data model will be off by default.

See the L2023.1 release notes for documentation of the old functionality.

Limitations

For Perspectives, Simply Ask (NLQ) permissions must be set manually and are not inherited from the root model. They can be set from the Perspective’s three dot menu.

NLQ API

Use the NLQ API to:

  • Find the APIs available to you so that you can configure dashboards programmatically
  • Some functionality exists only via API, such as adding/modifying an existing NLQ model 

To access the API:

  1. From the Admin tab, select REST API (either via the search or in the navigation pane on the left).
  2. Make sure you selected API version 1.0.
  3. Expand the NLQ heading.

Customization

Hiding the Table Structure from the NLQ Suggestions and Available Fields

Sisense provides advanced configuration options to hide the table structure in the NLQ suggestions and available field section in System Configuration > Simply Ask > Hide Table Names.

These settings will affect the NLQ behavior on a system level.

Note:

Simply Ask must be disabled and re-enabled on the dashboard level in order for the changes to be applied.

Customizing the NLQ Model

The following explains the structure and available customization options for the NLQ Model (also referred to as NLQ spec).

Default Dates

The default dates are located at the top of the JSON file: "defaultDateTable": "Commerce","defaultDateColumn": "Date". These are the dates that Simply Ask will refer to when you ask date-related questions, such as "What were my total sales last year".

When you have more than one date column and you perform a query based on date, an ambiguity will arise. To avoid this, specify the default date table and column in the JSON file.

Adding Aliases

Aliases are synonyms - alternative ways to refer to column names.

Sisense recommends adding aliases when you expect that your dashboard users will refer to a field by a term that is more familiar to them, rather than by its actual column name. For example: "Market" instead of "Country", "People" instead of "Employees", "Issues" instead of "Tickets", and so on. You can add as many aliases as you like.

In the following example, when you perform a query with Simply Ask, you can also use "Quota" to refer to the "Quantity" column:

{ "table": "Commerce", "column": "Quantity","type": "numeric", "applySynonyms": true, "aliases": [ "Quota" ] },

Applying Synonyms

As described above, the NLQ model defines that synonyms should be supported for all items in the model. You can turn this feature off for individual columns by setting applySynonyms to "false":

{ "table": "Commerce", "column": "Quantity", "type": "numeric", "applySynonyms": false, "aliases": [ "Total Quantity" ] }

Adding and Removing Columns and Formulas

All columns and formulas that appear in the dashboard automatically appear in the NLQ model.

You can add columns and formulas to the model's JSON file which enables users to ask about things that do not appear in the dashboard. When adding columns/formulas, make sure to use the same format as the existing columns/formulas, and to set the "type" parameter correctly, based on the relevant field type (text, numeric). For example:

{ "table": "gender", "column": "Gender", "type": "text","applySynonyms": true, "indexed": true }.

You can delete any columns/formulas you like from the NLQ model. However, NLQ will no longer recognize them and you will not be able to ask about them. (This does not affect the dashboard.)

Limitations

The following limitations apply to the Simply Ask (NLQ) feature:

  • Only the US date format is supported (month first).

  • The NLQ model does not support dashboards that are linked to more than one data model.

Note:

For users using Simply Ask prior to 2023.2.

Starting with Sisense version 2023.2 there are some major improvements in the setup flow.

Existing Simply Ask users from earlier versions who want to enable the new Simply Ask improvements described here will need to enable this functionality by having the system Admin call the nlq/nlqAdvancedMode API.