Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro's are not working on Access Point(AJAX)

Hi all;

I created 3 macro's YTD,QTD&MTD, when i select in application those are working but when i selected in access point(AJAX) those macro's are  not working.can any one advice me how to solve  it.

I used this code in macro's edit module

       sub YTD

         ActiveDocument.GetSheetObject("CH121").Activate

         ActiveDocument.GetSheetObject("CH122").Activate

      end sub;

.......etc........

I checked Allow unsafe macro's on server.

Thanks,

Ashok.

6 Replies
Miguel_Angel_Baeyens

Hi,

Some macros do not work in Ajax, and that is the expected behavior. What events are you using to trigger those macros? A button, an action, when you change a value in a field?

Regards.

Miguel

Not applicable
Author

Hi Miguel,

I used button & action is "Run macro".

Miguel_Angel_Baeyens

Hi,

Use conditionals based on a variable value instead. For example, the button sets a variable named "vYTD" to 1 when clicked. The charts have a conditional like

vYTD = 1

so they are only displayed when you click on the button. Check an example app here. This will work in Ajax and you prevent using macros.

Hope that helps.

Miguel

Not applicable
Author

Hi,

But actuvally if i select YTD button then it shows 1-bar chart & 1-stright tabe as comparing last 3 years means i used 3 expressions in YTD.

like that QTD&MTD also then how.

Miguel_Angel_Baeyens

Hi,

What if you click on the QTD button first? Does it work and the rest of buttons quit working? You are just activating objects and not modifying expressions, aren't you? If all charts are in the same sheet, then I'd insist on the use of variables and conditional visibility instead. If they are in different sheets, you will need to first activate the sheet where the charts are.

Not having the QVW makes difficult to guess the layout and functionality.

Miguel

Not applicable
Author

Hi,

I used that set variable method but that is suitable for only two butttons but i need 3 buttons.

i used like this

            variable:    V=1

YTD Button:

Button -  action - Set Variable ->v

Value:

     =If(v = 1, 2, 1)

Text:

      =if(v=1,'YTD','YTD')

In chart, use v variable  in Layut-conditional  - show = v=1

QTD Button:

Button -  action - Set Variable ->v

Value:

     =If(v = 1, 2, 1)

Text:

     =if(v=2,'QTD','QTD')

In chart, use v variable  in Layut-conditional  - show = v=2

How do i create MTD Button?

Set variable taking two values true/false.