Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Macro Question

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]


2 Replies
Not applicable

Macro Question

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

Macro Question

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]


Community Browser