Add (targets)
add(name: string, filter: Filter, isOlap?: Boolean): Target
- Provide the name of the target. The targets are named in the Present dashboard template.
- The filters are one or more embed based filters.
- The isOlap flag is designed to indicate if the target filters are for an MDX based datasource.
- You can chain a set of "add" functions to built a composite of targets.
Example
The following creates 2 sets of filters (fil0 for dates, fil1 for countries). Each filter is then directed to a specified target (target0 and target1) - as named in the dashboard. These are then attached to the embed method using the EmbedOptions object.
var fil0 = filter.by("dates","years","2020"); var tar = Target.add(name: "target0",fil0,false); var fil1 = filter.by("customers","country","USA").add("customers","country","AU"); tar.add(name: "target1",fil1,false); client.embed($("myContainer"), {contentId:"c20d42b4-be24-47cf-b711-d5782f048590", targets:tar});