Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Solving the Informatica Dilemma: On-Demand Briefing - Watch On Demand!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Edit module keeps poping up on every select i do.

HI,

I created a simple macro, to check a few conditions on every select and change the value of a variable. First i used a csv file to load data. THen i switched to a mysql server  using simple load commands :

ODBC CONNECT TO CT_server (XUserId is xxx, XPassword is xxx);

SQL SELECT *

FROM Arjun.`Dummy_Data`;

SQL SELECT *

FROM Arjun.`Dummy_Data_Benchmark`;

But when i did this, now everytime i click on any filter to select some dimensions, the edit module pops up instead of executing the macro.

Pls help,

the macro is:

Sub test2

if ActiveDocument.Evaluate("GetSelectedCount(Field1)")=0  and ActiveDocument.Evaluate("GetSelectedCount(Field2)")=0 and ActiveDocument.Evaluate("GetSelectedCount(Field4)")=0 and ActiveDocument.Evaluate("GetSelectedCount(Field3)")=0 and  ctiveDocument.Evaluate("GetFieldSelections(Field5)='Overall'") then

 

                    ActiveDocument.Variables("vShow").SetContent 1,True

              ActiveDocument.Variables("vShow2").SetContent 0,True

    else

              ActiveDocument.Variables("vShow").SetContent 0,True

              ActiveDocument.Variables("vShow2").SetContent 1,True

    end if

End Sub


1 Solution

Accepted Solutions
marcus_sommer

You mixed terms from GUI and macro - for correct syntax and many suggestions see APIGuide.qvw in your installation. In your case you need none macro, you could do it directly in variablen-editor:

vShow

= if(GetSelectedCount(Field1) = 0 and

     GetSelectedCount(Field2) = 0 and

     GetSelectedCount(Field3) = 0 and

     GetSelectedCount(Field4) = 0, 1, 0)

vShow2

= if(GetSelectedCount(Field1) = 0 and

     GetSelectedCount(Field2) = 0 and

     GetSelectedCount(Field3) = 0 and

     GetSelectedCount(Field4) = 0, 0, 1)

- Marcus

View solution in original post

1 Reply
marcus_sommer

You mixed terms from GUI and macro - for correct syntax and many suggestions see APIGuide.qvw in your installation. In your case you need none macro, you could do it directly in variablen-editor:

vShow

= if(GetSelectedCount(Field1) = 0 and

     GetSelectedCount(Field2) = 0 and

     GetSelectedCount(Field3) = 0 and

     GetSelectedCount(Field4) = 0, 1, 0)

vShow2

= if(GetSelectedCount(Field1) = 0 and

     GetSelectedCount(Field2) = 0 and

     GetSelectedCount(Field3) = 0 and

     GetSelectedCount(Field4) = 0, 0, 1)

- Marcus