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.

Activating Simply Ask

To activate Simply Ask for your system:

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

To activate it, select Feature Management on the Admin tab, and in the Advanced Analytics section toggle on Simply ask (NLQ). Then 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 NLQ Model

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

NLQ Model Creation

The model is created per dashboard when you enable Simply Ask on that dashboard. By default, the model includes all the formulas, fields, and filtered fields that already appear in the dashboard.

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.

Custom NLQ Model Creation

The NLQ Model can be customized by API only.

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.

We recommend 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" ] },

Apply 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.)

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).

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

Applying Filters in your Queries

You can apply filters and sorting to your data as follows:

Filter Type

Query Example

Specific dates and ranges of different date levels (year, quarter, month, week, day)

Revenue 2019 Revenue by month 2019

Common time-frame periods such as 'last 2 weeks' and 'this quarter'

Revenue last 2 weeks

Common time-frame periods such as 'last 2 weeks' and 'this quarter'

Revenue last 2 weeks
Common holidays and public events, such as "Black Friday". Revenue Black Friday 2019

Top / Bottom ranking filter.

This type of filter enables you to include only the top / bottom ranking fields.

The top 5 countries with the highest income

Aggregation functions:

Sum /Total, Count all, Count unique, Min, Max, Average, Median

Total sales 2019, Minimum deal size 2019

Break-bys of values by another category

Sum sales by product

Text filters

You can use the following filters:

Starts with, Ends with, Containing, Equals, Doesn't Start With, Doesn't End With, Doesn't Contain, Doesn't Equal
Products by total revenue where category starts with 'tablet'

Value (Member) filters

Single-select and multi-select filtering of specific values (members)


  • Sum sales where products is Product A
  • Total sales of Product A
  • Sum sales by products where products in (Product A, Product B, Product C)
  • Sum sales by products for Product A, Product B and Product C

Dashboard formulas

Filters on dashboard measures (formulas)

MAU (Monthly Active Users) in Tier 1 customers

(If MAU is a formula in your dashboard)

Dashboard filters

Filters currently applied on the dashboard

MAU in Tier 1 customers

(If MAU is a filter currently applied on your dashboard)

Ascending and descending sorting

Sum sales by products sort by sales DESC

Reserved keywords (for example: yesterday, >)

Full list of reserved words:

  • Top/ highest
  • Bottom/ lowest
  • Between
  • Larger/ greater/ more / >
  • Larger or equal/ greater or equal/ >=
  • Smaller/ less/ <
  • Smaller/ smaller or equal/ <=
  • Equal/ =
  • This day/ this week/ this month/ this quarter/ this year/ today
  • (Last/ past) day/ week/ month/ quarter/ year/ yesterday
  • (Last/ past) X day/ week/ month/ quarter/ year
  • X day/ week/ month/ quarter/ year ago
  • Next day/ week/ month/ quarter/ year/ tomorrow
  • Next X day/ week/ month/ quarter/ year/ tomorrow
  • Starting / from date
  • Until/ till/ to date
  • Like / contain
  • Start / begin with
  • End with
  • Sorting
  • Sort (default is descending)
  • Sort ascend / sort ascending / sort ascendingly
  • Sort descend / sort descending / sort descendingly
  • Date break by
  • By days / weeks / months / quarters / years
  • Daily / weekly / monthly / quarterly / yearly

Total Sales yesterday

Deal size > 5,000

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.


Click to pin the current Simply Ask results to your dashboard as a widget.

Note:

This feature is available for users with Designer permissions who are using Sisense version L8.2.6 and above.

Click to download a PNG image file of the visualization.

Click to save your query for later beneath the Simply Ask field.

 

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.

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.