Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to hide a sheet object when another sheet object is minimized

As the title says, I'd like to hide a sheet object if a given chart is minimized and show the object if the same chart is shown.

How can I do that?

4 Replies
johnw
Champion III
Champion III

Not so easy. My understanding is that QlikView simply doesn't yet have the triggers that would be required to make it work reliably. I believe the consensus suggestion is to instead use buttons to minimize/hide and maximize/unhide all of the related objects at the same time. Others may have other ideas.

Not applicable
Author

I have 4 charts in a sheet and 1 slider. The slider only reflects it changes in one of the charts. So I'd like to hide the slider if the specific chart is minimized.

mongolu
Creator
Creator

You could use this VBS function.

'Function ConditionalShowObject(strSourceObjectID,strTargetObjectID)
Function ConditionalShowObject
'Set SourceOBJ = Activedocument.GetSheetObject(strSourceObjectID)
'Set targetOBJ = Activedocument.GetSheetObject(strTargetObjectID)
Set SourceOBJ = Activedocument.GetSheetObject("CH01")
Set targetOBJ = Activedocument.GetSheetObject("SL01")
Set tProp = targetOBJ.GetProperties
tProp.Layout.Frame.Show.Always = False
If SourceOBJ.IsMinimized Then
tProp.Layout.Frame.Show.Expression.v = "0=1"
Else
tProp.Layout.Frame.Show.Expression.v = "1=1"
End If
targetOBJ.SetProperties tProp
Set tProp = Nothing
Set targetOBJ = Nothing
Set SourceOBJ = Nothing
End Function

(for chart objects you must use "GraphLayout" instead of "Layout")


The problem is when you double-click the chart to minimize or restore it, it doesn't trigger any event (if the chart was already selected/activated before the double-click).

But, you may try to put the function on Deactivate event on the chart you want to link with the slider, and see if it is convenable (still, the user must deactivate it to slider appear/disappear).

Not applicable
Author

Mihai,

Thank you very much for your help. It does not work as I'd like because there is no event related to maximize or minimize object (I guess It should be in future versions), but it works if the user click outside the object in case of the chart is already selected.