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.
Step 1: Define the filter
-
On the Dashboards page, select Add filter.
-
Choose filter type
Node property. -
Select the label
Customer. -
Select the property
City.
Step 2: Link the parameter
-
A parameter named
$customer_cityis created automatically. -
Set the default value to
London. -
Select Save.
Step 3: Add a card
Paste the following query into the Cypher input, then select Save:
MATCH (n:Customer)
WHERE n.city = $customer_city
RETURN n.companyName
Changing the city in the filter updates the table dynamically.
Link a parameter to a filter
Step 2: Add a parameter
-
Select Add.
-
In the dialog, enter a parameter name
unit_param, select the value typeinteger, set the default value to4, then select Save.
Figure 5. How to set up a parameter with a number value of 4 named "unit_param"
Step 3: Add a card
-
Add a card.
-
Paste the following Cypher into the card, then select Save:
MATCH (p:Product)
WHERE p.unitsInStock = $unit_param
RETURN p.productName AS product, p.unitsInStock AS units
LIMIT 10
Step 4: Define the filter
-
Add a filter.
-
Select the filter type
Node property. -
Select the label
Product. -
Select the property
unitsInStock.
Step 5: Link the existing parameter
-
Select existing parameter, then select
$unit_param. -
The default value is
4(changing it overrides the parameter default). -
Select Save.
The parameter and filter are now connected.
Selecting a value from the dropdown updates the parameter $unit_param and updates the table.