Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Members,
I tried to search a lot for this but couldn't find the answer anywhere, apologies if this has been asked already. I am fairly new to Qlik sense.
However I do not know the syntax, I don't want to have to create separate variables for different conditions. Any help is much appreciated.
Thank you.
Hi,
It all depends on how your v_avg_days_for_objects is defined.
Let's say the original expression is Count([Days]). To be able to pass the parameter you'll have to redefine it as
Count({$<DummyField, '$1'>}[Days])
in this case you can use your variable in the following way:
$(v_avg_days_for_objects(object_type={"New"}))
This is a simplified approach, which allows you to pass only one parameter and one filter, but it can be enhanced to accept as many parameters as you want.
Regards,
Sergey
hi,
I want to call the variable as it is with an additional condition, so no functions used.
Thanks.
Undoable. Filters (aka set analysis) are part of the expression. You can write your expression specifically in a way that make them (somewhat) customizable on the fly as Sergey suggested, but other than that you just need to write a new separate expression (and keep it in a new separate variable if you want) for the KPI object.
If this is about keeping consistency between the formulas (e.g. it's already long and complicated and you just want to add one extra filter) then you could consider splitting the formula in smaller blocks in separate variables and combining them as needed.