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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
suniljain
Master
Master

How to select last week through Macro ?

Suppose my current week is 36 . I want to select last week through macro.

week field is WORK_WEEK.

3 Replies
Not applicable

Hi Sunil,

if you wanna select current week first you must create a variable CurrentWeek (you can name it whatever you want): =week(Now()) . And the macro will be:

sub SelectWeek

set v = ActiveDocument.Variables("CurrentWeek")

ActiveDocument.Fields("WORK_WEEK").Select v.GetContent.String

end sub



Stefan

suniljain
Master
Master
Author

done

ActiveDocument.Fields(

"WORK_WEEK"). Select ActiveDocument.Evaluate("LastWeek"

)





tresesco
MVP
MVP

Hi,

I would prefer Trigger for the same. Its good to avoid macro !