Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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