Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I wish to select previous month as soon I open a Qlikview Dashboard. I have tried various expression e.g.
I have a field called [Start Date of Month] to represent each month , so I tried ActiveDocument.GetField("Start Date of Month").Select ActiveDocument.Evaluate("=AddMonths(Max([Start Date of Month]),-1)") But Max([Start Date of Month]) work's with the Current month but when I use AddMonth with -1 for previous month the Time value I hope is truncated & it doesn't select Desired result.
I have tried various ways but because the Time Factor along with date get's truncated it is not working. If someone could give any suggestion. Thanks in advance
With Regards
Amar
Hi,
You can create an variable with expression as below to get the previous month;
X=Month(AddMonths(today(),-1))
And select the month using macro
Get the variable as string
ActiveDocuemnt.Fields("[Start Date of Month]"). Select X
I hope the above will help you.
Regards
Rajesh
Hi Rajesh,
It won't work since in my database [Start Date of Month] is an DateTime Field & in Qlikview Month(AddMonths(today(),-1)) will give me some value that just has a Date Value & not the time along with it so the selection don't work in this case. If some one has faced such a problem please reply.
with regards
Amar
HI,
Create month from '[Start Date of Month]' filed in qlikview and use that field for selection.
ActiveDocument.Fields("[CREATED MONTH]").Select X
- Sridhar