NLQ: Advanced Intelligence

Advanced intelligence describes additional capabilities in the Natural Language facility that relate to time (by month, this year, in the future), place (by country, in Australia), proper noun (for John, by Juanita), and using advanced analytical methods (forecast, cluster, and so on).

In its simplest form, Pyramid's Natural Language interfaces take a user's question, interprets that question, searches for the entities (hierarchies, members, and measures) in the current data model, and applies basic analytic functions (like filtering and sorting). It then returns an intelligent AI-driven visualization comprising the results. These basic tenets are extended by implementing advanced intelligence capabilities related to time, location, proper nouns, and analytics.

Tip: The Chatbot is "cumulative", so you can continue updating, changing, and even interacting with the query with subsequent questions.

Time Intelligence

Time Intelligence brings an extra layer of AI-driven querying to the user by allowing the user to write classic analytic date-time based questions. The engine can then use these as a basis for either finding the right date-time elements in the data source or for building formulations of time automatically to draw the appropriate result.

For time intelligence to operate, there must be date-time hierarchies in the model by data type, by category type, or by name.

Time Intelligence Cues

To use time intelligence, you must ensure that the data source has date-time attributes; that these entities (hierarchies) that either appropriately named or categorized as date-time related. This can be done in the data modeling tools within Pyramid, or you can add an overlay to your view of the data model in the admin console or using Discover.

The following key concepts demonstrate how to employ the time intelligence logic:

  • By period: by year, by quarter, or by month - both generically and specifically.
    • Generics: "Show sales by promotion by month" will draw a set of line charts for sales by promotion by month (found by name or column type).
    • Specifics: "Show sales by promotion in 2018" will draw a chart of sales by promotion for 2018 data. The 2018 data will be auto-calculated using calendar periods Jan 1 2018 through Dec 31 2018.
  • Last period: last year, last month, last week,
    • "Show sales by promotion for last year" will draw a chart of sales by promotion for 2019 data by using the current year's date (2020). The 2019 data will be auto-calculated using calendar periods Jan 1 2019 through Dec 31 2019.
  • Last x periods: last 3 years, last 6 months, last 2 weeks
    • "Show sales by promotion for last 2 years" will draw a chart of sales by promotion for 2018 through 2020 data by using the current date (2020). The 2 years of data will be auto-calculated using calendar periods Jan 1 2018 through Dec 31 2020. Note: In the event the data does not extend into that time span, it will be measured as of data ending the last date in the system.
  • This grouped period: this year, this quarter, this month, this week
    • "Show sales by promotion for this month" will draw a chart of sales by promotion for June 2020 using the current date (June 30th 2020). The month of data will be auto-calculated using calendar periods June 1 2020 through June 30 2020. Note: In the event the data does not extend into that time span, it will be measured as the of data ending the last date in the system.
  • Expected in x periods: for example, for the next 2 weeks. This makes use of forecasting.

Non-SQL based Data Sources

NLQ does not support the same level of time intelligence operations for MS OLAP, Tabular, and SAP BW data models, so it's not possible to specify a date or time period. This means that asking a question such as "Product sales last year" will not return a query. However, it is possible to group or classify a query by a date or time period. For example, "Product sales by year" will work if there is a hierarchy or attribute in the model (or cube) called "year."

Note: It is possible to use NLQ forecasting with these models if they have the appropriate model structures.

NLQ Geo Intelligence

The NLQ Geo Intelligence brings an extra layer of AI-driven querying by allowing the user to write questions in natural language ("plain English") referencing global landmarks - notably countries, states, and cities. The engine can then use these as a basis for finding the right member elements in the data source to draw the appropriate result.

Note: For geo intelligence to operate, there must be geospatial hierarchies in the model either by category type or by name.

Geo Intelligence Cues

To use geo intelligence, you must ensure that the data source has geospatial attributes that are properly categorized as geospatial related. Furthermore, the elements must be named in the standard way they would appear in English.

The following key concepts demonstrate how to employ the geo intelligence logic:

  • By Country: both generically and specifically.
    • Generics: "Show sales by country" will draw a map of sales all countries - as designated by the attribute type "country".
    • Specifics: "Show sales by promotion in Australia" will draw the relevant chart for sales by promotion and filter the data using the country attribute, specifically on Australia.
  • By State: both generically and specifically.
    • Generics: "Show sales by state" will draw a map of sales all states - as designated by the attribute type "state".
    • Specifics: "Show sales by promotion in New York" will draw the relevant chart for sales by promotion and filter the data using the state attribute, specifically on New York. "Show sales by promotion in New York and California" will include both states as a multi-select slicer to the report.
  • By City:
    • Specifics: "Show sales by promotion in Boston" will draw the relevant chart for sales by promotion and filter the data using the city attribute, specifically on Boston. Importantly, the city name needs to be capitalized.

Geo-Boundaries

Create a geo-boundary, which is a context calculation that divides the map into two members: "in" (the geo locations within the radius of the geo-boundary), and "out" (the geo locations outside the geo-boundary).

Set the geo-boundary by specifying a distance in relation to a geospatial attribute. For instance: "Show sales within 50km of Sydney."

Note: geo-boundaries are not supported for OLAP, Tabular, and SAP BW.

NLQ Proper Noun Intelligence

Similar to the "Geo" intelligence, the NLQ Proper Noun Intelligence allows the user to write questions using the names of people. The engine can then use these as a basis for finding the right member elements in the data source to draw the appropriate result.

Note: For proper noun-intelligence to operate, there must be categorized hierarchies of type "person".

Proper Noun Cues

  • The use of capitalized text is required - indicating to the engine that the entity provided is a name. For example "Show sales by John last year"
    • The full name is provided, the name must be held in a single hierarchy. The engine will not match up to two separate hierarchies for first and last name.
  • The names that will be recognized are those most popularly found in general use, in English.

Advanced Analytical Methods

Forecasting

You can perform forecasting using the NLQ by asking questions referring to projected time periods. It's crucial to use correct grammar and prepositions when asking forecasting questions; use of the preposition "the" before the unit of time is particularly important, as it ensures correct interpretation of the date / time unit. For example, all three of these examples will attempt to forecast data out into the future: "Trend sales by month"; "Forecast expenses for the next 3 years"; "What will my costs be in the next 12 months."

Outliers

You can find statistical outliers within the current result set using the NLQ, This will generate the outlier flags as a dynamic hierarchy that can then be used for further analysis (slice, dice, and so on.). To show outliers simply write "Show sales by promotions with outliers." In the Chatbot, you can write "Add outliers."

Regressions or Trends

You can add regressional values to the current result set using the NLQ, The engine generates the trended values and adds them to the analysis. To show regressions simply write "Compare sales to expenses by promotions and show a regression of sales to expenses." To get more reliable results, it is recommended to say explicitly what measure should be regressed against which other measure.

Clustering or Grouping

The Clustering function is a specialized context calculation that generates a new custom column, statistically calculating ways to classify the current query's data points into groups (or clusters).

You can apply clustering to the query using the NLQ by asking to show clusters, for example "Show bike sales by promotion with clusters." In the Chatbot, you can simply write "cluster." By default, the query will be split into 5 clusters. You can specify a different number of clusters if needed. For instance "Split into 3 groups."

Note: clustering is not supported for OLAP, Tabular, and SAP BW.

Interpolation or Fill the Blanks

You can interpolate and complete missing values in the current result set via the NLQ. The interpolation function or 'fill the blanks' will statistically calculate any blank values in a query's results. You can apply interpolation to the query via the NLQ by asking to fill the blanks "Show tax numbers for color compared to class and fill in any blank values".

Explain

You can use the Explain capability to generate a partial decision tree segment analysis of the specified data point, retrieving the most dominant drivers of the value or its key Influencers - depending on how the question is asked. To retrieve an explanation for a visible data point in the current visualization simply write "Explain why bike sales in the United States are so high."

If the question is asked to "deconstruct," instead of explain (for influencers), the dominant drivers are returned .

Note: "deconstruct" is supported for the Pyramid Internal engine (PLM) only.

Explain the Difference

Use the Explain the Difference capability to generate an analysis of the key influencers behind a difference between two data points. This is an extension to the main Explain functionality. To retrieve an explanation for a difference between two visible data points in the current visualization simply write "Explain the difference between bike sales in the United States and bike sales in Australia."

Note: Explain the Difference is supported in for the third-party LLM engines only.