Simply Ask: Query in Natural Language
Applicable to Sisense on Linux
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)
- Simply Ask (NLQ) Security
- Activating Simply Ask (NLQ)
- Modifying the NLQ Model
- Asking Questions
- Applying Filters in your Queries
- Saving Your Query for Later
- Limitations
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:
- Your SisenseAdministrator 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. - 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. - 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).
- 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.
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"
]
},
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:
- Indexing columns consumes CPU and memory. If you index columns with many values, NLQ performance may be affected.
- You are limited to indexing up to 10 fields per ElastiCube or Live model, across all of your dashboards. For each indexed column, Sisense saves the top 20,000 values (ElastiCube) or the top 5,000 values (Live models).
- By default, Sisense indexes all of the text columns that appear as dashboard filters. These are included in the limit of 10 columns. If you don’t want them to be indexed, you can manually change them to “indexed”: false in the JSON file.
- If you have an indexed text column with many values and you apply synonyms, it might cause the system to slow down. In this case, you might want to turn off synonyms.
- NLQ models are refreshed after every build to include new values
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 wknowledge-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:
- 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.
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 only supports 5000 raw 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) 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”. |
|
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:
|
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.
Limitations
The following limitations apply to the Simply Ask (NLQ) feature:
- You can index up to 10 fields per ElastiCube. This number is aggregated from all dashboard-level NLQ models that are built on that ElastiCube. This limitation does not apply to Live models.
- You can index up to 20,000 members per indexed field in ElastiCube. If there are more members, the index will include only the first 20,000.
- You can have up to 5,000 members per indexed field in Live models.
