Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
gautik92
Valued Contributor III

Clearing the filters with always one selected value

I have 2 set of filters

1.CalYear and CalMonth

2.AsofYear and AsofMonth

and I have 2 buttons if I select 1stbutton calyear and calmonth will be visible

if I select 2nd button asofyear and asofmonth will be visible

but all these filters will be having always one value selected

so now I want to clear asofyear and asofmonth when 1 button is selected and calyear and calmonth should be cleared when 2 button is selected

this is possible if we don't have always one value selected but I want this with always one value selected

any idea..

Thanks in advance

1 Reply
MVP
MVP

Re: Clearing the filters with always one selected value

A macro like below can do so.

Sub RemoveAlwaysOneSelectedMonth

    set obj = ActiveDocument.GetSheetObject("LB01")

    set boxfield=obj.GetField

    set fprop = boxfield.GetProperties

           fprop.OneAndOnlyOne = False

            boxfield.SetProperties fprop

            ActiveDocument.ClearAll True

End Sub