Skip to content
Lisa Zhang edited this page Dec 3, 2013 · 2 revisions

WikiAPI ReferenceFilter

Filters can be defined when only a subset of the data are to be visualized. Charts, pivot tables, and numerals all use the same syntax for specifying filters.

Filter Object

A filter object is an associate array of data columns to an object o with one or more of the below attributes. Each attribute imposes a restriction on the data points to be kept. Only data points that satisfies all the restrictions are kept.

o.gt

A value that all points visualized should be greater than

o.ge

A value that all points visualized should be greater than or equal to

o.in

A list of all values to keep

o.le

A value that all points visualized should be less than or equal to

o.lt

A value that all points visualized should be less than

Example

We will use the below data set through the examples

a | b | c
------------
2 | 3 | A
4 | 2 | B
3 | 1 | A
1 | 0 | B

Example 1

Filter object:

{
a: {
gt: 3
}
}

Result:

a | b | c
------------
4 | 2 | B

Example 2

Filter object:

{
c: {
in: ['B']
}
}

Result:

a | b | c
------------
4 | 2 | B
1 | 0 | B

Example 3

Filter object:

{
a: {
ge: 3
le: 4
}
c: {
in: ['A']
}
}

Result:

a | b | c
------------
3 | 1 | A

Clone this wiki locally