Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
ivandrago
Contributor II

Activate Button based on selection

Hi,

I have the attached Document, within there, there is a Button on the "Main" Sheet called Go to Sheet and when you click on it, it will go to the Sheet "Active Sheet".

I only want this button to be enabled if the field OriginalTable has been selected and has a value AND the field _AreaFlag is greater than 0 (Zero)

I have tried the following confition but it is not working

=Len(Trim(GetCurrentSelections(OriginalTable))) > 0 and _AreaFlag > 0

Thanks

6 Replies
bcavestro
Contributor

Re: Activate Button based on selection

Pls try the following condition:

Count(DISTINCT{<OriginalTable=p(OriginalTable),_AreaFlag={">0"}*p(_AreaFlag)>}Area)>0

and GetSelectedCount(OriginalTable)>0

mporrey01
New Contributor II

Re: Activate Button based on selection

Hello Ivan,

You can try this:

=(Len(Trim(GetFieldSelections(OriginalTable))) > 0) and (_AreaFlag > 0)

Best regards,

Marco

ivandrago
Contributor II

Re: Activate Button based on selection

Hi, can this be done without the field "Area" in the formula?

bcavestro
Contributor

Re: Activate Button based on selection

You can count whatever is needed .. .the advantage of selecting Area is that with the distinct you'll get 0 or 1, according to data provided

ivandrago
Contributor II

Re: Activate Button based on selection

So what would the formula be if lets say the field Area was not on the table and only had four fields left.

bcavestro
Contributor

Re: Activate Button based on selection

As long as Area is on the script, it doesn't matter if you show it or not.

But let's suppose that you don't have it ... you could even use OriginalTable in this way:

Count(DISTINCT{<OriginalTable=p(OriginalTable),_AreaFlag={">0"}*p(_AreaFlag)>}OriginalTable)>0

and GetSelectedCount(OriginalTable)>0