Possible to hide single global filter?

Hi all,


SHORT VERSION OF QUESTION:
In Apliqo is there any way to hide a single “Global Filter” from users? I know each “Dashboard Fixed Value” has a “Hide From Toolbar” button in the GUI. I don’t see this for “Global Filters” though, neither in the GUI or the JSON options. Any known workarounds?


…alternatively…


Is there a way to exclude an Apliqo report from inheriting a specific global variable for just one dimension so that my report defaults to the first item in the list, rather than using the global variable value in cache?


…alternatively…


Is there a way to dynamically define a “Default Value” in a global filter so that it defaults to a value denoted by a DBRW lookup or the first element in a given subset?



CONTEXT OF QUESTION:
I have two cascading time dimensions. Year value filters options shown in year-month. This works fine, except user wants to also have report open with a specific year-month element displaying...namely whichever element is currently in the "Relative Time - Last Month YTD" subset on that dimension.

The MDX I’ve placed in the [T Year-Month] dimension MDX to create the cascading time-dimensions is shown below. Note it includes my attempt to put the user’s preferred element top of the list and have that become the default.

{TM1FILTERBYPATTERN(*
{*
{TM1SubsetToSet( [T Year-Month].[T Year-Month], “Relative Time - Last Month YTD”)},*
{TM1SORT(*
{TM1SUBSETALL( [T Year-Month] )}*
, ASC)}*
}*
, “" + [}ElementAttributes_T Year].([}ElementAttributes_T Year].[Caption], [T Year].[$<<apliqo.T Year.T Year>>]) +"-MYTD*”)}*

The MDX above gives me exactly the list I need, but it doesn’t pick the first element from the list as the report default, even though I have cleared the “Default Element” property for this dimension. Instead it seems to be remembering a global default from other reports.


Simplest answer is probably to "turn off" the [$<>] variable from carrying over into this specific report. If I can do that, I'd hope my above MDX would then display the first element in the list, which is always the value I want.


Failing that, being able to include dynamic logic in the “Default Element” field could let me build a query to get the element I want. (Ideally as the first element in my subset, else a DBRW reference as second choice).

In absence of the above two options I have tried going a third option. I dropped the [T Year-Month Clone] dimension into my Global Filters. I created my “Relative Time - Last Month YTD” subset in the clone dimension, then set the MDX on the clone dimension to reference that subset, displaying only a single element, which is the one I want. I then took the [$<<apliqo.T Year-Month Clone.T Year-Month Clone>>] variable and set that as the default in my [T Year-Month] dimension and I finally have a cascading list with the correct default! However… I now have this nasty [T Year-Month Clone] dimension in my toolbar that I need to hide. I’ve tried creating an empty Toolbar Popup, using the JSON in that popup to point to a custom HTML file, then setting some dummy CSS in that file to see if I am hooking the filter I want to hide. But my test CSS isn’t registering, so now I’ve come to the forums.

For reference, my custom toolbar JSON is this:
{
“toolbarButton”: {
“htmlSnippet”: “analytics/PL_BS_YTD_GlobalFilter_EditCSS.html”
}
}

And the custom HTML snippet is this:

#global_filter_apliqo\\.T Year-Month\\ Clone\\.T Year-Month\\ Clone { color:red !important; }

The ID tag was found by inspecting the element in the report and then adding the \ escape before periods and white space.

UX has been built from the ground up to always be context aware and pass the current member selection when navigating pages. This is what we refer to as the “setting service” which sets the filter values. You can access the setting service values and treat them as variables to pass into titles, info text, or MDX using the $<<instance.dimenson.hierarchy>> notation which can be extended to attribute values using $<<instance.dimenson.hierarchy::attributeName>>

Unlike Workspace where context sharing needs to be set up for each widget/hierarchy combination to create channels to listen to and share context, in UX all widgets on all pages are always listening to the setting service. Whenever the default value for a filter or fixed hierarchy is left empty this means “get the current value from the setting service.” To override this default you set a different value as the default element. The entry accepts plain text or setting service variable. At this point you can’t use MDX or a cell reference.

If the setting service doesn’t contain a value for the key of the instance.dimension.hierarchy then the first member of the list defined for the hierarchy will be taken as the filter value and that value will be inserted into the setting service. (The same applies when a default element is set, this value replaces the current setting service value for that key.)

So the TLDR to this point is basically the setting service doesn’t work the way you seem to think it should as empty default element means keep the current context.

Although being able to set a default element value via cell reference or MDX may be the ultimate (and easiest) solution for your issue, there are a couple of current workarounds I can think of.

  1. You can manipulate the setting service (change a key, add a key) via a custom javascript function which could be run on navigation to the screen in question. Use a js function to either delete the key for T Year-Month or set it to the value you need (which you know the logic for.)
  2. Basically a version of the solution you describe. Create a dummy hierarhcy which just contains the value you want, and then reference the dummy with a setting service variable to override and set the setting service value for T Year-Month

To HIDE a filter don’t worry about custom css. What you need to do is UPGRADE. This is now a standard feature from version 2022.12 onwards (so at this point upgrade to 2023.02 FP2)
image

1 Like

Thanks very much for your quick response cw-ch!


^ The above is exactly how I thought the setting service worked. I was just wondering if there was any way to make it stop working like that by exception for a given variable for a given report. Sounds like there is not though.


^ Hmm… I’ll need to look into where and how I call a JS function. I have no worries working in JS for Canvas. Don’t have any experience firing JS in Apliqo though or interacting with Apliqo’s rootScope. Definitely something I want/need to learn though.


^ Yes this is the solution I ended up implementing, as detailed in my OP. It works great except that I then had an ugly dummy dimension that I couldn’t hide. (And at that point I came here for help). Looks like it’s definitely time to upgrade off 2021.07 FP1 though! Glad to hear it’s a feature in the latest version!! :slight_smile:

No worries. From your description it just sounded like you expected something different when the default element value was empty.

You can find some js function examples in the demo app
\webapps\Apliqo_Demo\apq-c3-custom\js\jsfunctions-filterbar.service.js

e.g. setting the value for Year and Month dimensions from the current selection for the Year-Month dimension.

let year = this.Settings.settings['ApliqoFPM.T Year-Month.T Year-Month'].substring(0, 4);
let month = this.Settings.settings['ApliqoFPM.T Year-Month.T Year-Month'].substring(5, 8);
this.Settings.change('ApliqoFPM.T Year.T Year',year );
this.Settings.change('ApliqoFPM.T Period.T Period',month );
1 Like