Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a problem in where i'm showing a Balanced Score Card on my dashboard. My employer asked me to select the previous month by default so that the tables show some values when the user views the dashboard. The only way conceivable of doing this, as I have found so far is to create a Macro function that runs on a trigger when OpenDocument occurs. I was able to get the current month and year by doing this:
sub DefaultLAFP2
v_monthyear = UCASE(Monthname(Month(now()),TRUE)) & " " & right(Year(now()),2)
ActiveDocument.Fields("MonthYear").Select v_monthyear
end sub
The MonthYear field has values such as: JAN 13, FEB 13, MAR 13, etc...
When I tried putting the -1 after the Month I was unable to get the desired result. I believe this is because QlikView doesn't let you subtract a month since in January it would crash. How can I achieve what I need? Help please.
You don't have to use a macro. You can add a Select in Field action to the trigger instead. Choose MonthYear as field and try as search string =date(addmonths(today(),-1),'MMM YY').
You don't have to use a macro. You can add a Select in Field action to the trigger instead. Choose MonthYear as field and try as search string =date(addmonths(today(),-1),'MMM YY').
That was the exact solution that I wanted. Thank you very much for your response.