Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik Community,
I am struggling with a calculation which is fairly heavy causing my whole report to run slowly.
However, the calculation is only relevant if the user has made some selections.
I would therefore like to add a calculation condition so that the calculation is only evaluated if the user has made selections.
It seems like I am only able to use calculation conditions in KPI's. However, it is required that I use text and image objects in the report...
Does anyone know a way to implement calculation conditions on a text and image object or alternatively apply a calculation condition directly on the measure?
Cheers
It will just evaluate "Show condition for chart" and if it is true, it will show that particular visualization.
You may add it like:
How about using an IF condition with GetSelectedCount() function to check whether there are any current user selections on particular fields? For example
=If(GetSelectedCount(City) = 0, 'Please select at least one city', Sum(Sales))
BR,
Vu Nguyen
That was my initial though as well. However, I found out that Qlik sense evaluates all inputs in an IF-statement no matter what condition is fulfilled in the statement.
Example in the expression below both "Expression1" and "Expression2" will be evaluated no matter the size of "A".
It evaluates all inputs and returns the correct one.
IF(A>1,
[Expression1],
[Expression2])
It's strange. The IF condition works in my example below
Can you share the expression and maybe some sample data?
You may also explore Custom Objects > Show/hide container
The expression works, yes.
But Qlik will evaluate both expressions - As in it will use CPU's and calculation time to calculate both expressions.
It will return the right result yes, but even if you do something like:
IF(GetSelectedCount(Field1)<2, 0, [Heavy expression])
your measure will still run slow because it evaluates the 'heavy expression' before returning the value '0'...
It is just qlik functionality..
Does the Hide/show container evaluate all the visualisations when it is used?
Or does it first evaulate when the "Show condition for chart" is fulfilled?
It will just evaluate "Show condition for chart" and if it is true, it will show that particular visualization.
You may add it like: