Discussion Board for collaboration on QlikView Scripting.
I have the following issue:
Im trying to select only the last 30 days in a Macro Sub.
I 2 Have qlikview Variables:
1. "vMaxDate" gets the max date we have in the system
2. "vMinDay30" gets the max date -30.
So I would like to select everything in between.
my Sub is:
mySelect= ">" & First & "<" & Last
but even after I test it, it does not select a thing.
please can you share your qvw?
I replicated with an own example and the macro works fine.
Works for me. Check that the date format is correct. You can add some msgbox statements to check the values of the variables.
Anyway.... why use a macro at all? The Clear All and Select in Field actions work just as well and will also work work correctly in the ajax client.
Hi, you don't need a Macro for this requirement. Just create a Button or text object and create Action with "Select in Field" option
Field: Date Expression: ='>=$(=Max(Date)-30)'
dathu.gv ... I created a button and pasted in exactly what you recommended and it does not work:
Select in Field
Field: Date (yes my system has a "Date" field)
Search String: ='>=$(=Max(Date)-30)'
Macro works fine
dathu is correct; a button and Select in Field will work.
Always format your dates, in qlikview.
Field name: [Rpt Date]
value field: = max(date([Rpt Date],'MM/DD/YYYY'))