Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following syntax in a variable which shows a button depending on what the variable returns. The button is placed within a graph so when the user drills down to status level the button will appear: -
if(getselectedcount(Status)=1,1,0)
As there are more than one graph on the page with the status option I want the button to only appear within the grpah that the selection comes from.
Does that make sense?
Example - CH01 has the button but the user selects a status from CH02....I don't want that button to appear unless the selection comes from CH01
Can anyone help??
Hi Sam,
Let me make sure if I had understood the requirement. You wanted to show the "Show Detail" button only when you select "Declined" from Tender Status chart. I mean if you select "Declined" from other sources you don't want to show the button. I am assuming this is what you need.
If this is what you need. Then I got it working in the attached example. Here are the steps...
1. Created one more variable called vTest
2. Created a VB Script procedure
Sub ShowButton()
Set obj = ActiveDocument.GetSheetObject( "CH01" )
IF Obj.IsActive = True Then
ActiveDocument.Variables("vTest").SetContent 1, True
Else
ActiveDocument.Variables("vTest").SetContent 0, True
End IF
End Sub
3. Created a trigger on the Status Field for OnSelect event
4. Amended the Button condition to =$(vShowDetail)=1 and vTest = 1 (Both conditions should be passed to show the button)
My VB Script procedure works on IsActive property of CurrentSelection Class. I mean when I select the chart ("CH01") in our example then it sets the value of vTest variable to 1 else 0.
I hope this makes sense and let me know you need further help!
Cheers - DV
Yes it is possible. Please can you load the sample QV document? I can work an example with your sample data?
Cheers - DV
I've attached the QVW as requested!
Hi Sam,
Let me make sure if I had understood the requirement. You wanted to show the "Show Detail" button only when you select "Declined" from Tender Status chart. I mean if you select "Declined" from other sources you don't want to show the button. I am assuming this is what you need.
If this is what you need. Then I got it working in the attached example. Here are the steps...
1. Created one more variable called vTest
2. Created a VB Script procedure
Sub ShowButton()
Set obj = ActiveDocument.GetSheetObject( "CH01" )
IF Obj.IsActive = True Then
ActiveDocument.Variables("vTest").SetContent 1, True
Else
ActiveDocument.Variables("vTest").SetContent 0, True
End IF
End Sub
3. Created a trigger on the Status Field for OnSelect event
4. Amended the Button condition to =$(vShowDetail)=1 and vTest = 1 (Both conditions should be passed to show the button)
My VB Script procedure works on IsActive property of CurrentSelection Class. I mean when I select the chart ("CH01") in our example then it sets the value of vTest variable to 1 else 0.
I hope this makes sense and let me know you need further help!
Cheers - DV
Hi,
Have you got chance to look at this one?
Cheers - DV
Morning DV,
Sorry for the late reply....I've tried to open it but I'm having a Qlikview licensing issue on my machine which is stopping me from viewing the QVW. I'm currently awaiting new licensing info from Qlikview as we speak, I'll let you know as soon as I've tested it!
Morning Mate. No problem at all. You can also follow the above steps incase this is urgent requirement. Do let me know if you neeed me to eloborate more information.
Cheers - DV
Morning Sam. I am just curious to know if you got chance to open the QV document?
Many thanks - DV
Hi mate,
I've literally just this second downloaded your QVW example!!
I'll take a look at the funcionality within the next 10 minutes and let you know...thanks for the help so far.
That worked a treat DV!!!
Thanks for the help...much appreciated!