Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Syntax error while testing the macro with date filter

I have coded a macro which clears all the selections and selects 1 year calendar dates. When I have coded below it is giving syntax error can I know what is the right way to incorporated condition in the macro

Sub SetClearState_Dashboard()

ActiveDocument.SetClearAll

v1.SetContent date()-365,true

ActiveDocument.Fields("calendar_date").Select ='>=' & DATE(ADDMONTHS(TODAY(),-12)) & '<=' & TODAY()

ActiveDocument.SetClearState

End Sub

1 Reply
Anonymous
Not applicable
Author

Sub SetClearState_Dashboard()

ActiveDocument.SetClearAll

ActiveDocument.Fields("calendar_date").Select calendar_date>=date()-365 and calendar_date<=date()

ActiveDocument.SetClearState

End Sub

When I ran above fucntion it is giving below mentioned error:

Object doesn't support this property or method: 'ActiveDocument.SetClearAll'

I have commented 'ActiveDocument.SetClearAll'

ran there are no compile errors but it is not filtering the dates when i am accesing from app.

Please help me calling setclearall function from macro and filtering the dates..