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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Type Mismatch while testing the macro

Hi,

   I am getting error while testing the macro in the qlikview.I wanted to set start date and end date variables which are used to filter my dataset.

Sub SetClearState_Dashboard()

     Set vStartDate = TODAY()

     Set vEndDate = TODAY()-366

End Sub

Type mismatch: 'TODAY'

Thanks

Dasu.G

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this,

     sub Test

          set v = ActiveDocument.GetVariable("Variable1")

          v.SetContent date(),true

          set v1 = ActiveDocument.GetVariable("Variable2")

          v1.SetContent date()-365,true

     End sub

Regards,

Kaushik Solanki    

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

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Use LET instead of Set.

sub date1(Date1)

Let ABC = Date1 - 365;

ENDSUB


Call date1(today())

Regards,

Kaushik solanki

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

I am trying to achieve this in vb macro.. There I am getting this erorr.. Not in the Qlikview script. Any idea in vb  macro how can we do this?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this,

     sub Test

          set v = ActiveDocument.GetVariable("Variable1")

          v.SetContent date(),true

          set v1 = ActiveDocument.GetVariable("Variable2")

          v1.SetContent date()-365,true

     End sub

Regards,

Kaushik Solanki    

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