• InfoWorks WS Pro

Creating selection lists with imported data

InfoWorks WS Pro accounts for the demand on water networks, which can vary over time. Learn how to calculate the water that is required by users, and how demand impacts the network both positively or negatively at a given point and time.


Tutorial resources

These downloadable resources will be used to complete this tutorial:

iwsp2023M08U02_Crt_Lsts_w_Imp_Dt.zip

Step-by-step Guide

When using InfoWorks WS Pro, SQL is a flexible tool for importing and exporting data. In this example is a CSV containing a list of customers who have reported low water pressure. This example creates a selection list of these customers.

  1. In a file browser window, navigate to the folder containing the exercise data.
  2. In Notepad or a spreadsheet program like Microsoft Excel, open the Customers.csv file to check the structure.

The first value must be the name of the variable to be used; in this case, it is $customers. All values, or for this example, customer IDs, are separated by commas.

A Microsoft Excel spreadsheet with the Customers.csv file open and the first value highlighted in red.

  1. Close the file.

To locate the full file path, which is necessary to load it in an SQL query:

  1. In the file browser window, right-click Customers.csv and select Properties.
  2. On the Security tab, in the Object name field, select all the text.
  3. On your keyboard, press CTRL+C

The Properties dialog box for Customers.csv, Security tab, with the complete file path selected and highlighted in red.

  1. Click OK.
  2. From the Model Group window, drag-and-drop the BridgeNet network into the workspace to open the GeoPlan.
  3. In the Selection menu, pick SQL Select.

The InfoWorks WS Pro interface with the Selection menu displayed and SQL Select selected; and in the workspace, the BridgeNet GeoPlan open.

Your SQL query needs to load the list of customers, and then select any customers in that list.

  1. In the SQL dialog box, expand the Object Type drop-down and select Customer Point.
  2. In the text box, type: LIST $customers;

This defines the list variable you will load your CSV into. Remember that this must match the first value in your CSV.

  1. On your keyboard, press ENTER.
  2. Type: LOAD $customers FROM FILE ‘
  3. On your keyboard, press CTRL+V to paste the complete file path.
  4. Type another apostrophe ().
  5. Type a semicolon (;).

This loads your CSV into the list variable.

  1. Type: SELECT WHERE MEMBER(reference, $customers)

This will select any customer whose reference field is in your $customers list. Your syntax should match the image below:

The SQL dialog box with the SQL query entered.

  1. Click Test to ensure the query syntax is correct.
  2. In the notification, click OK.

The SQL dialog box with Test highlighted in red and the notification with OK selected.

  1. Click Apply.

There should now be customers selected in the network. If the customers are not visible:

  1. Move the SQL dialog box to one side.
  2. Right click in the GeoPlan and select Find selection.

The GeoPlan shortcut menu with Find selection selected and called out.

  1. Close the SQL dialog box.
  2. In the Model Group window, open the existing Selection Lists group.

OR, to create a new one:

  1. Right-click the Selection Lists group.
  2. Select New > Selection List.

In the Model Group window, the Selection Lists shortcut menu with New selected, and in the flyout, Selection List selected and called out.

  1. Name the selection list “Customers”.
  2. Click OK.

To clear the current selection:

  1. On the Operations toolbar, click Clear Selection.
  2. From the Model Group window, drag-and-drop the Customers selection list into the GeoPlan to re-select the customers.

In the Operations toolbar, Clear selection highlighted in red, and below, the mouse pointer dragging the Customers selection list from the Model Group window into the GeoPlan.

Now, repeat the process in reverse, and then export the affected customers:

  1. With the Customers still selected, in the Selection menu, pick SQL Select.
  2. In the SQL dialog box, expand the Object Type dropdown and select Customer Point.
  3. Enable Apply Filter to Current Selection.
  4. Type the following query: SELECT reference INTO FILE ‘
  5. On your keyboard, press CTRL+V to paste the file path to the CSV again.

Note: If needed, repeat Steps 4-7 to copy the full file path.

  1. Change the filename to CustomersExport.csv.
  2. At the end of the filename, type an apostrophe ().

The SQL dialog box with the export SQL query entered and Apply selected.

  1. Click Test to make sure that the query syntax is correct.
  2. Click OK.
  3. Click Apply.
  4. Navigate to the data folder, where you will find a list of exported customer IDs.

A Microsoft Excel spreadsheet with a list of exported customer IDs.