Like what you see? Have a play with our trial version.

Error rendering macro 'rw-search'

null

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The filter object can be accessed as follows:

For a report:

report.filters


And for a dashboard:

dashboard.filters


This Filters API contains all of the available user prompt filters for a piece of content as well as various methods that allow developers to manipulate the filter. It also can fire a number of events that allows your applications to react to changes within the filters.

...

Applied values are the values that are currently being used by the report or dashboards to filter the query result. Anytime the API uses getAppliedValue it is referring to these values.

A staged filter value is a value that is set in the Filter but not yet applied to the report output. For example, in the filter ‘Demographic” “Demographic” when a user selects the value “Adventure” this sets the staged value of that filter to “Adventure”. Anytime the API uses setValue or getValue, it is referring to the staged value of the filter. This is not reflected in the report or dashboard until the filters are applied. 

Some filters will also have defaultValues, these are always read only.


Understanding Values

Throughout this reference document and the FilterObject reference document, you will see references to different value objects.

E.g. valueOne, valueTwo, appliedValueOne.

Yellowfin uses these values to correctly apply the filter values when running a report. 

ValueOne will refer to the value of a filter that has a single input option (Equal To, Different From, etc). It will also be used as the lower value in a between operator (Between and Not Between) so when using a between operator valueOne should always be lower than valueTwo. 

ValueList is the value used for a list operator (In List, Not In List) and is an array of string or number values.


Differences between report and dashboard filters

From a functionality point of view, there is very little difference between a report filter and a dashboard filter object. A dashboard filter object serves many reports as it will have linking objects that allow many reports to be linked to a single filter. 

When building a dashboard in Yellowfin, users will first add reports to the dashboard and then add filters from those reports to the dashboard. This is described here.

A filter added to a dashboard will be allocated its own unique filter id, even though it is derived from a report filter in the first instance. This Dashboard Filter will continue to maintain a reference to the report filter from which it was based. Changes made to report filters will flow through to dashboard filters. 

If you have code that references a report filter by UUID it will be accessible in a report filters object by that UUID:

report.filters.getFilter('47fe96c2-5101-4b0d-9018-7d12a84d3519');

If that report and filter were then added to a dashboard, you would no longer be able to use the exact same code to access the dashboard filters. This is because it is possible for there to be multiple instances of the report and filter active on a dashboard together, so they are all referenced by their dashboard filter uuid.

dashboard.filters.getFilter('47fe96c2-5101-4b0d-9018-7d12a84d3519'); //Will return null 


Property Reference

No properties associated with the Filter object need to be accessed to utilise the API functionality.