So, we all know that QlikView only spends resources on calculating objects when they are visible, right? WRONG! If you have many hidden objects on a page, check out the Sheet Properties, tab Objects, and see that the hidden objects still draw substantial Calc Time, even if they remained hidden from the very beginning.
We knew that Show/hide conditions, Calculation Conditions and calculated Captions are being recalculated with every click, but this time I’m pretty sure that the objects are being fully calculated while they are hidden.
So, the good news is — when the object becomes visible, it won’t require any more resources to get calculated. The not-so-good news is that if you have many hidden objects on the page, the initial wait time might be too long, even if the users will never need to navigate to those hidden objects.
We ended up with a work-around. We duplicated our “Show Conditions” within the “Calculation Conditions”, to ensure that the objects are not getting calculated until they become visible. The initial wait time was visibly improved.
If you only have a few objects to worry about, you can do it manually. If your dashboard has many tabs, and each tab has many charts, you might need some automation. Below is a simple macro that does the job, with just a few caveats, that might need your manual attention:
1. If your Calculation Condition has a comment, marked with two slash signs “//”, the combined solution may not work.
2. If your Show Condition is “Always”, and at the same time there is a Show/Hide condition (grayed out), it will get populated anyway. I only discovered this glitch recently. I will post an update to the script as soon as I have time to clean it up…
Use “at your own risk” 🙂
Appreciate everyone’s thoughts.
on error resume next
for sheets = 0 to ActiveDocument.NoOfSheets – 1
set ss= ActiveDocument.GetSheet(sheets)
Objects = ss.GetSheetObjects
For i = lBound(Objects) To uBound(Objects)
If (Objects(i).GetObjectType >= 10 and Objects(i).GetObjectType <=23) or Objects(i).GetObjectType =27 or Objects(i).GetObjectType >= 28 or Objects(i).GetObjectType >= 37 Then ‘Charts
set chart = Objects(i)
set cp = chart.GetProperties
if len(trim(cp.GraphLayout.Frame.Show.Expression.v)) > 0 then ‘ IF Show Condition Exists
if len(trim(cp.EvaluationCondition.v)) >0 then ‘ IF Calc Condition already exists
cp.EvaluationCondition.v = “(” & cp.EvaluationCondition.v & “) & (” & cp.GraphLayout.Frame.Show.Expression.v & “)”
cp.EvaluationCondition.v = cp.GraphLayout.Frame.Show.Expression.v