Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I read the AddMonths functions in the help file. I could not understand the use of [Mode] parameter. What is the use of this Parameter?
I had gone through the examples given in the help file, but i can't understand perfectly.
addmonths ('2003-01-29',1,1) returns '2003-02-26'
addmonths ('2003-01-29',1,0) returns '2003-02-28'
Look at the above examples, by adding mode the result has changed. How?
Regards,
Raghu.
Hi Raghu,
With the 0 in the Mode, you get it adding 1 month to 29th January - it will come up with 29th February which, unless it is a leap year, is not a valid date so it gives you the last valid date of that month.
With 1 in the month it works out that the 29th January is the 3rd last day of January - the 3rd last day of February is the 26th.
Regards,
Stephen
Hi Raghu,
With the 0 in the Mode, you get it adding 1 month to 29th January - it will come up with 29th February which, unless it is a leap year, is not a valid date so it gives you the last valid date of that month.
With 1 in the month it works out that the 29th January is the 3rd last day of January - the 3rd last day of February is the 26th.
Regards,
Stephen
Thanks Stephen,
I got it..
Thanks,
-Raghu
Hello Stefan,
Could Please give me bit more explanation on this what is "mode" can do?
Hi
Stephen
Please check my expression using Mode my problem is solved
I used following expression and use 1 mode for hadling leap year
addmonths(max({$<FiscalYear={$(=max(FiscalYear))}>}[Posting Date]),-12,1))
http://community.qlik.com/message/325264#325264
Please reply whether this is correct way.
Thanks
Vikas