Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sushil353
Master II
Master II

Help me to write a macro..

Hi all,

i have a field in which data is

NDF

NDR

NDF_CLEAR

NDF_TEST

NDF_APPLICATION

i want to write macro and create 3 buttons like 1. button for NDF 2.button for NDR 3. button for NDF and NDR

if i press button 1 then only NDF get selected

if i press button 2 then only NDF and NDR get selected

and if i press button 3 then all NDF and NDR get selected

Please help me out to solve this problem..

Thanks

Sushil

2 Replies
Not applicable

Hi Sushil,

this is taken from the ApiGuide.qvw from the "Field" class:

ActiveDocument.Fields("Month").Select "September"

ActiveDocument.Fields("Month").Select "J*"

ActiveDocument.Fields("Sales").Select ">1500"

C u,

Stefano

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

   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.

   Load

        Field1,

        if(Wildmatch(Field1,'NDF*'),'NDF',

               if(Wildmatch(Field1,'NDR*'),'NDR')) as NDF_NDR

 

  From xyz.

   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.

Regards,

Kaushik Solanki   

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!