Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

camilo
New Contributor III

Macro - Select all but

Hi,

I´m Trying to make a macro that selects everything except one tipe of field.

Right now I know if I want to select that one field I have to use:

Sub Reempaque
ActiveDocument.Fields("Variedad").Clear
ActiveDocument.Fields("Variedad").Select("Reempaque")
end sub

But I want to select all the other fields but "Reempaque" what do I have to use?

Thanks,

Tags (2)
1 Solution

Accepted Solutions
Highlighted
disqr_rm
Valued Contributor III

Macro - Select all but

Sub AllOtherThenReempaque
ActiveDocument.Fields("Variedad").Clear
ActiveDocument.Fields("Variedad").Select("Reempaque")
ActiveDocument.Fields("Variedad").SelectExcluded

end sub

4 Replies
Not applicable

Macro - Select all but

You can use ToggleSelect to unselect a selected value.

So if you use:

Sub Reempaque
ActiveDocument.Fields("Variedad").SelectAll
ActiveDocument.Fields("Variedad").ToggleSelect("Reempaque")
end sub


Highlighted
disqr_rm
Valued Contributor III

Macro - Select all but

Sub AllOtherThenReempaque
ActiveDocument.Fields("Variedad").Clear
ActiveDocument.Fields("Variedad").Select("Reempaque")
ActiveDocument.Fields("Variedad").SelectExcluded

end sub

camilo
New Contributor III

Macro - Select all but

Thanks very much Rakesh and Nmiller, I tried the SelectExcluded option and it does work perfectly!

Not applicable

Macro - Select all but

I tried just this below to create a macro. This selects all items in a the field. However I want to be able to just pick 1 item, any item in that field. However I cannot name a specific one because that will always be different. Any ideas on how to just get it to pick one, maybe the first in the list?



function

{

ActiveDocument.Fields(

"ResidentName").ToggleSelect("*")

}





Select()