Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro Question

I am trying to write a macro that will automatically select the last 13wks when a button is clicked.

I have tried

[ ActiveDocument.Fields(

"PickupWkStart"). Select ">=weekstart(Today(), 0, -1)-13"] ]



I found this selects every week availabel not just the ones i want. Any ideas?

The PickupWkStart field is just teh sunday of the week in standard MM/DD/YYYY format.

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

Sending again:


sub Semanas4
ActiveDocument.GetField("Year").Select ActiveDocument.Evaluate("year(today(1))")
ActiveDocument.GetField("Semana").Select ActiveDocument.Evaluate("'>'
<div><pre> & num(week(today(1))-4) & '<=' & num(week(today(1)))")
end sub
[\code]


View solution in original post

2 Replies
Not applicable
Author

Hello Pat,

This macro will selesct the last 13 weeks of the current year.

sub week13
ActiveDocument.GetField("Year").Select ActiveDocument.Evaluate("year(today(1))")
ActiveDocument.GetField("week").Select ActiveDocument.Evaluate("'>' & num(week(today(1))-13) & '<=' & num(week(today(1)))")
end sub
Not applicable
Author

Sending again:


sub Semanas4
ActiveDocument.GetField("Year").Select ActiveDocument.Evaluate("year(today(1))")
ActiveDocument.GetField("Semana").Select ActiveDocument.Evaluate("'>'
<div><pre> & num(week(today(1))-4) & '<=' & num(week(today(1)))")
end sub
[\code]