Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
samvile18
Creator III
Creator III

Is this possible

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??

1 Solution

Accepted Solutions
IAMDV
Luminary Alumni
Luminary Alumni

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

View solution in original post

10 Replies
IAMDV
Luminary Alumni
Luminary Alumni

Yes it is possible. Please can you load the sample QV document? I can work an example with your sample data?

Cheers - DV

samvile18
Creator III
Creator III
Author

I've attached the QVW as requested!

IAMDV
Luminary Alumni
Luminary Alumni

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

IAMDV
Luminary Alumni
Luminary Alumni

Hi,

Have you got chance to look at this one?

Cheers - DV

samvile18
Creator III
Creator III
Author

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!

IAMDV
Luminary Alumni
Luminary Alumni

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

IAMDV
Luminary Alumni
Luminary Alumni

Morning Sam. I am just curious to know if you got chance to open the QV document?

Many thanks - DV

samvile18
Creator III
Creator III
Author

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.

samvile18
Creator III
Creator III
Author

That worked a treat DV!!!

Thanks for the help...much appreciated!