COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Cognos88Newbie on 13 Oct 2017 08:25:37 AM

Title: compare prior MTD sales with MTD in daily basic
Post by: Cognos88Newbie on 13 Oct 2017 08:25:37 AM
Hi, I would like to ask how I can compare prior MTD sales with MTD in daily basic.  I tried to create 2 different query but is not working.

eg:

Date (MTD) :      1/2     2/2     3/2     4/2
Amt                   10       20      30      40

Date (Pr MTD) : 1/1     2/1     3/1    4/1
Amt                 50       60       70      80

VsDaily:            0.20     0.33   0.42   0.50

Something like that.

Thanks in advance.
Title: Re: compare prior MTD sales with MTD in daily basic
Post by: venkat01 on 15 Oct 2017 12:43:13 AM
I would creat two dataitems one is for MTD as case when Date >= trunc(current_date,'month') AND Date <=current_date then total(Amt) end
another one is for PMTD as
case when Date >= trunc(_add_months(current_date,-1),'month') AND Date <=_add_months(current_date,-1) then total(Amt) end
now you have two values you can compare these two dataitems apply any conditional formatting or whatever you want hope this helps you

Sent from my HTC One XL+ using Tapatalk
Title: Re: compare prior MTD sales with MTD in daily basic
Post by: venkat01 on 15 Oct 2017 03:06:32 AM
If you need daily same way creat 2 dataitems Currentday as case when Date >= trunc(current_date,'day') AND Date <=current_date then total(Amt) end
Prevmonthcurrentday as case when Date >= trunc(_add_months(current_date,-1),'day') AND Date <=_add_months(current_date,-1) then total(Amt) end
then compare daily sales monthovermonth

Sent from my GT-N8000 using Tapatalk