TIBCO Cloud™ Spotfire® Web Client User Guide

Creating an expression to limit the data to the bar-coded entry

When bar code reading capabilities have been added to the analysis, you can add a limiting expression on a visualization to filter to only the last scanned bar code.

Before you begin

Before you perform this task, you must have added the document property AppMachineReadableCode to the analysis, as described in Adding a bar code reading capability.

Some of the functionality described here can only be authored or accessed using the installed Spotfire client.

About this task

In the next step, limit the data to show only the row that matches the scanned item.

Procedure

  1. On the menu bar, click Data > Add calculated column.
  2. Add the following expression:
    If('${AppMachineReadableCode}' = '' or [barcode] = '${AppMachineReadableCode}', true, false)
    where [barcode] is replaced by the string column containing your bar code data. In the examples we have used a column called "ISBN" with ISBN codes.
  3. Provide a name, such as "IsBarCodeFiltered" and check to make sure the expression is of type Boolean.
  4. Save and close the dialog.
  5. Create or locate the visualization to limit and open the Visualization properties.
  6. Go to the Data section.
  7. Under Data limiting, click Add limitation and select Expression.
  8. In the Limit Data Using Expression dialog, select the column isBarCodeFiltered, and then click Insert Columns.
  9. Click OK to close and save the change.

Results

When the value of IsBarCodeFiltered is set to False, all data is shown. When the data is scanned using the bar code scanner on an iOS device, IsBarCodeFiltered is set to True and the data is limited to show the entry corresponding to the bar code only.

Testing bar code filtering

Procedure

  1. From your iOS mobile device, open the analysis containing bar code scanning capability.
  2. Tap the bar code icon.
  3. Scan the bar code (or QR code) of an item that is listed in the data table.

Results

The following image shows the text area and the table visualization after the bar code button has been pressed, that is, the value of the code captured, and the corresponding data in the filtered table.

  1. Filtered ISBN entry.
  2. The Bar code capture button has been used.
  3. The title associated with the ISBN entry in the filtered table.
Note: This analysis is for demonstration purposes and is not ideal for viewing on a small screen. For more information and advice on optimizing for a small-screen display, see the document Designing Spotfire Analytics for Small-Screen Display.