Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Generic Start
** xref:dashboards/import.adoc[Import and export]
** xref:dashboards/parameters-and-filters.adoc[Parameters and filters]
** xref:dashboards/filter-types.adoc[Filter types]
** xref:dashboards/list-param.adoc[list param]
** xref:dashboards/sharing-dashboards.adoc[Sharing dashboards]
** xref:dashboards/visualizations/index.adoc[Visualizations]
*** xref:dashboards/visualizations/graph.adoc[Graph]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions modules/ROOT/pages/dashboards/list-param.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
= List parameter

List parameters allow you to pass multiple values into a query and use them in Cypher queries.
Instead of filtering on a single value, you can define a list as an array,
This makes it easier to apply consistent filters across multiple queries.
Define the parameter once, then reference it in Cypher using the `$` prefix.

== Simple example (compare number of ordered items for countries)

Using xref:Northwind dataset

Example using a list parameter to work out `how much stuff does each selected country order?`

Using the Cypher query:

[source,cypher]
----
MATCH (o:Order)-[r:ORDERS]->(p:Product)
WHERE o.shipCountry IN $list
RETURN o.shipCountry AS country,
sum(r.quantity) AS unitsOrdered
ORDER BY unitsOrdered DESC
----

We can see that, `Germany orders way more units than UK, which orders more than France`

.list param countries
image::dashboards/parameters-and-filters/list-parameter.png[example]

//
Loading
Loading