Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Addmonths() function not working properly.

   Hi Community,

I have tried many examples to understand Addmonths() function. when i tried Examples which were mentioned in the reference manua , i got exact output.

But when i tried other examples with different modes , output is same.

Can any one explain What is the issue????

let x=addmonths('2012-1-20',1,0);     -----> 20-2-2012

let y=addmonths('2012-1-20',1,1);  ---->20-2-2012

Please explain , why two outputs are same Even modes are different????

 

15 Replies
Not applicable
Author

but i got output : 2013-2-20 ... is it correct ????

As per qlikview help it is wrong.

I have used mode 1.

Please execute it once then you will understand ..

Not applicable
Author

but i got output : 2013-2-20 ... is it correct ????

As per qlikview help it is wrong.

I have used mode 1.

Please execute it once then you will understand ..

CELAMBARASAN
Partner - Champion
Partner - Champion

It is correct!

Lets take your adding one month to the date.

Mode 1 is works differently only when the given date is greater than the next month end date. otherwise it will be same as  Mode 0.

Hope it helps

Celambarasan

Not applicable
Author

Satti,

It is your understanding of the situation that is flawed, not the computer program

y=addmonths('2013-1-27',1,1); - gives 2/27.

y=addmonths('2013-1-28',1,1); - gives 2/25.

y=addmonths('2013-1-29',1,1); - gives 2/26.

y=addmonths('2013-1-30',1,1); - gives 2/27

y=addmonths('2013-1-31',1,1); - gives 2/28

In short, 'mode 1' functions only at the end of the month. Otherwise it functions as normal.

Not applicable
Author

Hi other_people_shoes,

   I got your point. You are right.

mode 1 only works for 28,29,30,31 dates.

Thanks for your explanation.

Not applicable
Author

Hi other_people_shoes,

   I got your point. You are right.

mode 1 only works for 28,29,30,31 dates.

Thanks for your explanation.