Template filters & Hiding legend titles when value is 0

Hi all,

I’m currently creating a whole series of dashboards for release of our MVP! As part of this I’ve been using a lot of the same filters, can I create a template filter that can be re-used, that is in the same size and position (properties)?

In addition each dashboard will be different depending on which “account” logs in. As a result some “measures” will have 0 against their values, how do I ensure these are hidden when they are not relevant?

Many thanks,

Jack

Hey Jack!

Below are the answers to your questions.

Can I create a template filter that can be re-used, that is in the same size and position (properties)?

With “template filter”, I assume you want to know if you can create a filter in your template and can then later on use this filter to connect to visualizations on the dashboard that you build using this template. If this is your use case, then unfortunately, you cannot create a filter in your template and then attach it to the visualizations later on.

However, you can create a template cell dedicated to the filter in your template and can later on add the filter to this particular template cell for all the dashboard that use this template cell. Something like this spot:

templetefiltershidinglegendonzero-1

Now, when you use this template to create a dashboard you will just need to drag and drop your filter to this template cell and it will automatically adjust to this height and width thus maintaining consistency across the application.

How do I ensure these (measures with 0 value) are hidden when they are not relevant?

You can hide a measure using a small JavaScript code snippet. I have created a sample table visualization in which I have some measures out of which the value of one measure is all zero:

templetefiltershidinglegendonzero-2

Now, in order to hide this measure you have a couple of options. One option is that to manipulate the measures into a single hierarchy/dimension that could be selected on columns, for example using the Unpivot transform of Dundas BI data cube. Then you could filter the column dimensions.

Second, you can also make use of the JavaScript code snippet to hide the measures from the current visualization based on certain conditions. We have a sample script that hides the measures from a table visualization. You can refer to this script.

I hope this answers your questions. Please let me know in case you have any queries in this.

1 Like

We use a slightly different approach to this issue. We create a base dashboard. Inside this dashboard, we create our default set of filters and wire them to offscreen data grids. Additionally, we set the opacity of those filter tables to 0 %. Finally, we have a) a default array that contains the names of all parameters wired to onscreen visualizations, and b) a small block of code that iterates through the base set of filter parameters and sets their onscreen counterparts.

Whenever we want to add a new dashboard to a series, we simply copy the base dashboard as our starting point, design and wire the onscreen visuals exactly as you would a one-off, and then just add the name of any parameters used for onscreen visualizations into our default parameter array. And, voila, everything just works with no repetitive work in subsequent dashboards.

Two notes about this. First, we generally do a lot of other default things in our default dashboard, i.e. such as recording and retrieving navigation information (so that layer and filter selections are maintained as you use forward/back buttons, etc.), activating voice-control, etc. So, wiring the filters in is just an addition for us.

If you’re not in this boat, then just put the filters on your default dashboard but don’t wire them up to invisible filter tables. Still copy the default dashboard as your starting point, and then wire the filters to your onscreen visualizations after the fact.

3 Likes

@Wayne,

What happens when you want to change something involving your ‘base dashboard’. Do you have to go through and change all of the subsequent dashboards that you built from it?