COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: dollipi on 28 Apr 2017 07:02:06 AM

Title: MTD last year
Post by: dollipi on 28 Apr 2017 07:02:06 AM
Hello,

Need MTD from last year.

Have this for MTD:

Data Item named [Invoice extract]:
extract(month;cast([XDATEX];date))

+ 2x promt:

1)

[Invoice extract] = (extract(month;current_date))

2)

[XDATEX] between 2017-01-01 and 2017-12-31


How I can get MTD for last year in one query?

Thanks,

dollipi
Title: Re: MTD last year
Post by: BigChris on 28 Apr 2017 07:33:22 AM
[YourDateField] between _make_timestamp(year(current_date)-1,month(current_date),1) and _make_timestamp(year(current_date)-1, month(current_date),day(current_date)

...or something like that anyway  :D I haven't got cognos on this machine so I can't check for sure.
Title: Re: MTD last year
Post by: dollipi on 28 Apr 2017 08:36:35 AM
it doesn't work :(
Title: Re: MTD last year
Post by: BigChris on 02 May 2017 02:00:17 AM
Error messages?
Title: Re: MTD last year
Post by: dollipi on 08 May 2017 02:06:23 AM
no figures....