Simply Ask: Query in Natural Language

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 SisenseAI engine. Simply Ask offers an easy way for anyone, regardless of their role, to get insights from their data.

This document contains the following sections:

Minimum Requirements for Simply Ask (NLQ)

In addition to the basic Linux Minimum Requirements, your environment must have at least a minimum of 32GB of memory.

Simply Ask (NLQ) Security

NLQ results respect your data security. Users will not see any data that they are not authorized to see. However, Suggestions will be the same for all users. So, if the column containing the value "United States" is indexed, when entering the term "United", all users will see "United States" in the automatic next-word suggestions. This is regardless of whether or not they are authorized to see “United States” data. Of course, when the user runs the query, they will not be able to see any data relating to the “United States”, unless they are authorized to see it.

Activating Simply Ask (NLQ)

To add Sisense Simply Ask to your account:

  1. Your Sisense Administrator must activate Sisense NLQ on the system level. To do so, in the Admin page under Settings, enable Simply Ask (NLQ).

    For Live models, set the Live (Default Refresh Time) when Sisense indexes your Live models. This means that once per day at the time you define, Sisense indexes your Live models to create a library of terms to use when leveraging NLQ. You can set a specific refresh time for each Live model when you enable NLQ for that model.
  2. In the Data page, open the menu of each data model you want to enable Sisense Simply Ask for and select Enable Simply Ask (NLQ).

    For Live models, the first time you select Enable Simply Ask (NLQ) on that model, you need to enable it and you can set the Live (Default Refresh Time) for that specific model. This means that once per day at the time you define, Sisense indexes your Live models to create a library of terms to use when leveraging NLQ.
  3. In your dashboard, open the dashboard menu and select Simply Ask (NLQ) > Enable ‘Simply Ask’.

    The Dashboard Designer now has access to Simply Ask where they can ask questions and view the visualizations. This is a chance for the Designer to test the experience and modify the NLQ model, if necessary before exposing it to Viewers (see Modifying the NLQ Model).
  1. 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.

Modifying the NLQ Model

Simply Ask (NLQ) runs on a model that specifies all tables, columns, and dimensions that are available for querying via “Simply Ask”. Designers can modify this model via a JSON file. To access the JSON file, from the menu, click Simply Ask (NLQ) > Modify NLQ Model.

The model is created per dashboard, when you enable “Simply Ask” on that dashboard. By default, the model includes all the dimensions and filter information that already appears in the dashboard. You can make many different kinds of modifications, such as adding dimensions or enabling and disabling indexing for members (more about indexing below). You can even add aliases (synonyms). For example, if you know that your users tend to refer to “Country” as “Market”, you can create an alias that will associate the term “Market” with the field “Country”.

Note: Best practice is to use Simply Ask for a while and see if there are any missing synonyms or if other modifications to the model are required. Then go ahead and make the changes.

When you are satisfied with your changes, click Update. To revert the JSON script to its default status, click Restore to default and then Update. All manual changes are deleted.

This section describes some of the changes you can make to your NLQ model with the JSON file.

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, in the JSON file specify the default date table and column.

Adding Aliases

Aliases are synonyms - alternative ways to refer to column names. We recommend adding aliases in any case you expect that your dashboard users will refer to a field by a term that’s 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”, etc. 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

Sisense automatically detects synonyms for words that you use in your natural language query. For example, widget titles are added as aliases. For instance, if you have a widget showing sales by country and give it a title “Sales by Nation”, Sisense will automatically associate the word “nation” with “country”. You can turn this feature off for individual columns by setting applySynonyms to “false”.

{

"table": "Commerce",

"column": "Quantity",

"type": "numeric",

"applySynonyms": true,

"aliases": [

"Total Quantity"

]

},

Apply Synonym Members

When detecting synonyms, you can enable the applySynonymsMembers property to include field members for text items. For example, if the “Gender” field has a member “female”, when applySynonymsMembers is enabled, Sisense detects both “female” and “women”, because “women” is a synonym for “female”. When applySynonymsMembers is disabled, only “female” is detected. To improve performance, this property is disabled by default.

{

"table": "Commerce",

"column": "Quantity",

"type": "numeric",

"applySynonyms": true,

"aliases": [

"Total Quantity"

],

“applySynonymsMembers”: false

},

Index Columns

When you index text columns, the NLQ model saves all of the values in that column and associates the value with the column. This enables you to ask questions directly on the values. For example, when the “Country” column is indexed, you can ask “total revenue for Germany” because NLQ knows that the value “Germany” is associated with the “Country” column.

{

"table": "country",

"column": "Country",

"type": "text",

"applySynonyms": true,

"indexed": true

},

You can ask about values even if it’s column is not indexed by formulating your queries to use “contains”, “like”, “starts with”, or “ends with”. For example, asking “total revenue when gender contains female” will produce the same results for a non-indexed column as asking “total revenue female” when the column is indexed.

Notes:

Adding and Removing Columns

All columns that appear in the dashboard automatically appear in the NLQ model. You can add columns to the model’s JSON file which enables users to ask about things that do not appear in the dashboard. When adding columns, make sure to use the same format as the existing columns, and to set the “type” parameter correctly, based on the relevant field type (text, numeric).

{

"table": "gender",

"column": "Gender",

"type": "text",

"applySynonyms": true,

"indexed": true

},

You can delete any columns 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.

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 your 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 on 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:

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

Limitations

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

Limitations

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)

Note: You can filter directly only by the categories that are indexed in the NLQ model. Either they are used as filters in the original dashboard, or have been manually added as “indexed” in the NLQ model (see above). For example, let’s say that you have a Countries filter in your dashboard. Therefore, your query ‘Total Sales in France’ will produce a result. However, if you create a query ‘‘Total Sales by John Marks’’ (where John Marks is an Account Executive), it will not produce a result, unless “Account Executives” exists as a filter in the dashboard, or has been added manually as an indexed field to the model. If a value is not indexed, you can still ask about it - just not directly. You may ask about it using one of the text filters mentioned above: “like”, “contains”, etc. Instead of asking “Total sales by John Marks”, you can ask “Total sales by Account Executive contains John Marks”.

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

NLQ API

Use the NLQ API to:

To access the API:

  1. From the Admin tab, click REST API.
  2. Make sure you are in version 1.0 of the API.
  3. Expand the NLQ heading.

Limitations

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