Skip to main content

Hi there https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=9I would like to use nested variables:

I have a dropdown button with two items: 'dont filter and filter according to parameters.

When I choose the option dont filter I, well, dont want to apply filtering on certain components.

When I choose the option 'filter according to parameters I want to apply a filter that also takes one or more other variables into account.

Currently I have a variable that I use for filtering, where the variant including filters looks something like this:

FILTER "MY_TABLE"."MY_COL" > <%= myvar %>;

However, this does not seem to work as the myvar variable is not replaced by the value of the variable.

Any ideas how I can have a filter that is disabled, or executed using other variable(s)?

Hi Joos,
you can try to use
<% if(var != "don't filter") { %>
FILTER "MY_TABLE"."MY_COL" > 1;
<% } %>

as a component filter. You would store the dont filter and filter according to parameters option in variable var. If you select the dont filter in the button dropdown, the components filter will not be applied.
Hope this helps.
Best,
Viana

Hi Viana,

This reads like a nice feature to handle variables, with its own piece of (sub) codes within PQL.

Is there a help page somewhere where I can find more information about the var environment?

Best,

Joos


Hi Joos,
var is more of a variable than an environment. We unfortunately dont have documentation of statements like these.
Best regards,
Viana
Thank Viana, do you know (off the top of your head) if there are any other features/check you can do on vars, besides the IF?

Reply