Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
s33pie007
Contributor

How to add months to YYYYMM format

Hello everyone,

I have the following date format: YYYYMM. I would like to add a month to this format,

but it doesnt seem to work correctly.

for example, if I have a date 201201, the new value must be 201202.

If I have a date 201212, the new value must be 201301.

Help will be appreciated.

Thanks,

Stefan

Tags (1)
6 Replies
Partner
Partner

Re: How to add months to YYYYMM format

use this expression

addmonths(date#(yourdates,'YYYYMM',1)

Re: How to add months to YYYYMM format

and to format is again as YYYYMM, you can use Date() function

Date(AddMonths(Date#(yourdates,'YYYYMM',1), 'YYYYMM')

Not applicable

Re: How to add months to YYYYMM format

=Date(MonthEnd(Date#(YourValue, 'YYYYMM'))+1, 'YYYYMM')

nareshthavidishetty
Contributor III

Re: How to add months to YYYYMM format

Not getting the required format.

Thanks..

olivierrobin
Valued Contributor II

Re: How to add months to YYYYMM format

maybe that

let m=201212;

let m1=date(AddMonths(date#(m*100+1,'YYYYMMDD'),1),'YYYYMM');

Re: How to add months to YYYYMM format

Thanks for providing this information