Creating a Talking Report


Let’s continue to build upon the same report example that shows store revenue for different cities, and enable WebFOCUS to respond to your query verbally, instead of visually running a report. To do this, you must create a Compute expression that can read back a result, and specify a field to respond to your query. You must also enable User Selection, which specifies the correct output for the report.

Example: Creating a Compute With TALKTEXT in InfoAssist

  1. Open an existing report or create a new report in InfoAssist.
  2. Add a Compute expression to enable WebFOCUS to speak the answer back to you, instead of running the result in a report. To add a Compute field to your report or chart from InfoAssist:

    a. On the Data tab, in the Calculation group, click Summary (Compute).
    The Summary Field dialog box opens.
    b. In the Field text box, enter TALKTEXT.
    Note: The field being computed must be called TALKTEXT.
    c. Set the format. In this example, we use A200, but you can change this value to allow for more characters in the response, if needed.
    d. Enter the expression that WebFOCUS will read back to you with a result.

    In this example, the expression is formatted in the following way:

    ‘Text for expression’ | Data field | ‘Text for expression’ | Data field value | ‘Text for expression’ | Second Data field value

    The expression must contain text that will be used to construct a complete sentence or response, as well as the data fields required for your query.

    When creating the expression, the following conditions should be applied:
    • The text used to create the sentence or response should be surrounded in single quotation marks (').
    • Each segment of the reply should be separated by a pipe (|) symbol.
    • Use the FPRINT function, which converts any type of field (except for a text field) to its alphanumeric equivalent for display.
       
    The basic expression for this function is:

    FPRINT(in_value, 'usageformat', 'output')

    where:

    in_value 
    Is the value to be converted and is any format, except TX.

    usageformat 
    Is the usage format of the value to be converted, including display options. The format must be enclosed in single quotation marks (').

    output 
    Is the name of the output field or its format enclosed in single quotation marks. The output format must be long enough to hold the converted number itself, with a sign and decimal point, plus any additional characters generated by display options, such as commas, a currency symbol, or a percent sign (%).

    For example, the I8C format used below is converted to A12 because it outputs an integer, with commas, that is up to 8 characters in length. The output format of A12 is long enough to correctly output the converted number for Quantity Sold.
    In the following example, the Compute is set to read: "Store sales for the Store Name location were Revenue on total shipments of Quantity Sold."

    Talk text compute

    SUM is used as an aggregation function for both the Revenue and Quantity,Sold fields. You can apply aggregation functions (for example, Sum Average and Percent) to the numeric field that you select. In InfoAssist, you can access the Aggregation Functions menu by right-clicking the selected measure field, pointing to More, and clicking Aggregation Functions.

    Note: When you include an aggregation, ensure there are no spaces between the aggregation value and the field that you select.
  3. Change the output format to User Selection. Using this option allows Mobile Voice to automatically specify the correct output format for a talking report. This option can be enabled from the InfoAssist Properties section of the Administration Console by your Administrator. Once enabled:

    a. On the Home tab, in the Format group, click the drop-down menu and then click User Selection.

    User Selection option

    b. Click the Run button to run the report.
    c. Save the report.

    Then, you can define your intent phrase to be “Tell me about sales and shipments”, which results in the following verbal interaction between you and WebFOCUS:

    User: Tell me about sales and shipments.
    WebFOCUS:

    Sales and shipments result
    When you do not specify a parameter with a talking report, WebFOCUS replies with the first available value.

    The following image shows the fex behind the talking report that we just set up. The first highlighted area shows what the Compute looks like in the fex code, while the &WFFMT shows the output format detected by Mobile Voice that enables WebFOCUS to respond to your query with voice.

    Talking report fex example

    Tip: We recommend you use NOPRINT to guarantee that executing the standalone procedure and running it with Mobile Voice produce the same output.