Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Sheet Macros

I'm trying to set a macro so that when opening a sheet two options from the "Cateogory" field are selected. I'm not sure about the QlikView script to do so. Below is an example that I've tried that does not work. Any help is very much appreciated!





Sub

SetPain_Communication





ActiveDocument.Fields("Category").Select("Pain")

AND

ActiveDocument.Fields("Category").Select("Communication")





endsub





1 Solution

Accepted Solutions
Not applicable

Sheet Macros

Is your macro triggering properly, but only leaving you with Communication selected? The Select function makes the value passed the one and only selection when used.

You need:

ActiveDocument.Fields("Category").Select("Pain")
ActiveDocument.Fields("Category").ToggleSelect("Communication")


That should make Pain the only selected value and then also select Communication. You are left with both Pain and Communication selected.

2 Replies
Not applicable

Sheet Macros

Is your macro triggering properly, but only leaving you with Communication selected? The Select function makes the value passed the one and only selection when used.

You need:

ActiveDocument.Fields("Category").Select("Pain")
ActiveDocument.Fields("Category").ToggleSelect("Communication")


That should make Pain the only selected value and then also select Communication. You are left with both Pain and Communication selected.

Not applicable

Sheet Macros

That works! Thank you!!!