Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Date in field for macro

Hi,

I am trying to create a macro that will output a HTML format table. I want the selection to include any records with a date 90 days ago or newer.

While i can output the HTML table ok i cannot select the date range. I realise the macro has a fixed date which works fine but I need to include all dates from then to the present.

My Macro is simply

sub OnReload()

ActiveDocument.Fields("AllocationDateAHR").select Date-90

ActiveDocument.GetSheetObject("TB08").ExportHtml "\\san\Common\Allocations\Test.html"

end sub

I have tried set analysis in the above macro but it is not recognised.

All suggestions welcome.

Thanks

Clive

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

Try this:

     ActiveDocument.Fields("AllocationDateAHR").select ">=" & Date-90

View solution in original post

4 Replies
m_woolf
Master II
Master II

maybe: "=today()-90"

If not, create a variable defined as =today()-90 and bring the value of the variable into your macro.

Anonymous
Not applicable
Author

Thanks m

The statement ActiveDocument.Fields("AllocationDateAHR").select Date-90 actually works for selecting a single day but what I cannot figure out is how to capture all the dates after that. The script does not like < symbols.

m_woolf
Master II
Master II

Try this:

     ActiveDocument.Fields("AllocationDateAHR").select ">=" & Date-90

Anonymous
Not applicable
Author

M

You have nailed it with this one. Thanks for your input it has been really helpful.

Clive