Skip to content

Commit b9a4d83

Browse files
committed
docs: Multiple arguments in FILTER_PARAMS
1 parent 57beffd commit b9a4d83

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/pages/reference/data-model/context-variables.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,28 @@ type conversions in this case.
310310

311311
</InfoBox>
312312

313+
In the example above, the filter on a time dimension accepts two values: the
314+
lower and the upper bounds of a date range. If a filter accepts multiple values,
315+
they are passed to the function as individual parameters:
316+
317+
```javascript
318+
cube(`multi_filter`, {
319+
sql: `
320+
SELECT 123 AS value
321+
-- Multiple values: ${FILTER_PARAMS.multi_filter.dummy.filter(
322+
(...args) => JSON.stringify(args)
323+
)}
324+
`,
325+
326+
dimensions: {
327+
dummy: {
328+
sql: `1`,
329+
type: `number`
330+
}
331+
}
332+
})
333+
```
334+
313335
## `FILTER_GROUP`
314336

315337
If you use `FILTER_PARAMS` in your query more than once, you must wrap them

0 commit comments

Comments
 (0)