Filters

Filters are the main way to make dashboard charts interactive.

Filters can be created in two ways:

  • Add a filter and parameter

  • Link a parameter to a filter

Add a filter and parameter

Create a filter to see which companies are based in a city, with the default set to London.

filter by customer city
Figure 1. Example: Filter to see which companies are based in a city with the default showing London

Step 1: Define the filter

  1. On the Dashboards page, select Add filter.

  2. Choose filter type Node property.

  3. Select the label Customer.

  4. Select the property City.

  1. A parameter named $customer_city is created automatically.

  2. Set the default value to London.

  3. Select Save.

Step 3: Add a card

Paste the following query into the Cypher input, then select Save:

Cypher query for a table which displays customers within a city
MATCH (n:Customer)
WHERE n.city = $customer_city
RETURN n.companyName
london cypher query example
Figure 2. Cypher query for a table which displays customers within a city

Changing the city in the filter updates the table dynamically.

customers located at selected city
Figure 3. Filter and table showing customers located at the selected city

Step 1: Open the parameters drawer {}

drawer
Figure 4. How to access the parameters drawer

Step 2: Add a parameter

  1. Select Add.

  2. In the dialog, enter a parameter name unit_param, select the value type integer, set the default value to 4, then select Save.

    add parameter
    Figure 5. How to set up a parameter with a number value of 4 named "unit_param"

Step 3: Add a card

  1. Add a card.

  2. Paste the following Cypher into the card, then select Save:

Cypher query for a table which displays products with a certain number of units in stock
MATCH (p:Product)
WHERE p.unitsInStock = $unit_param
RETURN p.productName AS product, p.unitsInStock AS units
LIMIT 10
inquery
Figure 6. Using a parameter in a query to display products with a certain number of units in stock

Step 4: Define the filter

  1. Add a filter.

  2. Select the filter type Node property.

  3. Select the label Product.

  4. Select the property unitsInStock.

  1. Select existing parameter, then select $unit_param.

  2. The default value is 4 (changing it overrides the parameter default).

  3. Select Save.

The parameter and filter are now connected.

Selecting a value from the dropdown updates the parameter $unit_param and updates the table.

filter and card
Figure 7. Selecting a new value for the unitsInStock filter