Skip to Content

Generating Alerts Using a Derived Window in SAP HANA Smart Data Streaming

Part 6 of 9. Create and use Derived Window to analyze events, filter data, and generate alerts.
You will learn
  • Using a Derived Window to analyze events and filter data.
  • Using reference data from a HANA table for detecting alert conditions.
  • Step 1
    1. Click Derived Window in the Palette and drop it onto the canvas.

    2. Add a connector from AVG_TEMP to the new window.

      add connector
    3. Change the new window name to ALARM_TEMP and press Enter when done.

      rename to alarm temp
  • Step 2
    1. Click Add Column Expression f(x) icon shown below.

      add column expression
    2. Click the Copy Columns from Input menu item to execute it. You can also press c.

      copy columns from input
    3. Select all except for MIN_TEMP and TEMP_UNIT, then click OK.

      select columns
    4. Click Add Column Expression f(x) icon then Column Expression menu item to add a column to this window. Then repeat (i.e. add 2 new columns total). You can also press c.

      column expression
    5. Rename the first new column to ALARM_TYPE and press Enter key when done.

      rename expression
    6. Rename the 2nd new column to ALARM_DESC.

      name expression
    7. Double-click on simpleResultExpression6 to edit the expression.

      edit expression
    8. Enter 'TEMPERATURE' in the expression edit box for the ALARM_TYPE column. This will set the “type” of all alarms emitted by this window to the string “TEMPERATURE”. Press Enter key to confirm entry.

      rename expression
    9. Enter 'Machine not maintaining temperature' in the expression box for the ALARM_DESC column. Press Enter key to confirm entry.

      rename second expression

    How many columns does ALARM_TEMP have?

  • Step 3
    1. Now click Add Query Clause to add a query clause. We want to add a filter such that this window only contains rows for machines that have a current average temperature above the max specified for the machine.

      add query
    2. Click the Filter menu item to execute it. You can also press f.

      add filter
    3. Double-click on 1 under the Other tab to edit the filter expression.

      change filter expression
    4. Change the filter expression to: AVG_TEMP.AVG_TEMP > AVG_TEMP.MAX_TEMP. Use Ctrl+Space for completion assist.

      filter expression
    5. Click Compile Project icon to check for errors.

      compile for error
Back to top