Using NLQ On Your Data

How to:

Natural Language Query, or NLQ, lets you ask questions of your data using everyday language. This provides you with valuable insights and allows you to make informed business decisions.

NLQ translates natural language into SQL code that can be executed against a database. The natural language phrases are matched with relevant database schema columns within your data, and your query results display as a table. A maximum of 50 columns can be processed.

Examples of natural language queries include:

The NLQ engine understands the concept of time and supports different date formats. It supports one date/time column. You can refer to a date or date range in your queries, for example: sum profit for March 2013, or: sum profit for March 1 2013 to March 14 2014. The following exact date formats are supported: YYYY-MM-DD; YYYY/MM/DD; MM/DD/YYYY; MM-DD-YYYY.

Note: If NLQ becomes unresponsive, you can restart your java server to recycle the service. The recycle script uses nlp port9000, so any procedures already running on that port will be ended. The script must be re-run by the same user for it to work.

Procedure: How to Access NLQ from the Hub

You can access NLQ from the Hub and make natural language queries against your data to gain insights.

  1. From the HUB, click the plus menu.
  2. Click Explore Data.
    The Select Data Source dialog box opens.
  3. Navigate to your data source, as shown in the following image.
  4. Click Select.

    The Explore Data dialog box opens, as shown in the following image.

    The column names of your selected data source are displayed. You can choose a different data source by clicking Switch Data Source.

  5. Type a question about your data in the search field, as shown in the following image.

    Relevant column names that match your phrase display as you type.

    The NLQ engine can perform fuzzy matching on phrases. If you misspell a word it will recognize the correct schema column in your data. For example, a query for Dealer Cos will give a matching result for Dealer Cost.

    Note: If your data contains a column titled Time, queries will fail. The column should be renamed to an alternative, such as Time1, for a query to work properly.

  6. Click Ask.
    The result of your query displays as a table, as shown in the following image.

    You can run your query results in a new window by clicking the output options button and selecting Run in new window.

    Note: If your query does not result in matching data, the NLQ engine will suggest rephrasing your query, and offer examples to model your queries after.

  7. Click Close to close the dialog and return to the Hub.

Procedure: How to Save Your NLQ Results

When you use NLQ on your data, your results display as a table. You can easily save your results for future use.

  1. Click the output options button .
  2. Select the Save to workspace option.

    The Save dialog opens, as shown in the following image.

    You can title your visualization and save it to a location you choose.

  3. Click Save.