this is taken from the ApiGuide.qvw from the "Field" class:
test_macro.qvw 132.2 K
You dont need macro to achieve this.
All you need is a new field from the table. Let me explain in detail.
You need to do like this.
if(Wildmatch(Field1,'NDR*'),'NDR')) as NDF_NDR
Now place this field as a filter.
You will have 2 values, i.e NDF and NDR, so whenever you click on NDF the data will get filter for NDF and same like NDR. Now when you want both, then dont select anything.
So you dont require Macro.
Hope you understood.