COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: dollipi on 13 Jun 2014 04:49:47 AM

Title: WTD
Post by: dollipi on 13 Jun 2014 04:49:47 AM
Hello,

how I can get Week to date? Can anyone help?

BR
D.
Title: Re: WTD
Post by: BigChris on 13 Jun 2014 05:13:53 AM
Give us a clue...
Title: Re: WTD
Post by: dollipi on 13 Jun 2014 05:22:59 AM

I have a report that show the YTD and MTD. Now I need WTD

For MTD I use this:

Date Item: extract(month;cast([Invoice Date (Inv)];date))

+

Filter: [Extract] = (extract(month;current_date))

But "week" doesn't work....

Title: Re: WTD
Post by: dollipi on 13 Jun 2014 05:24:09 AM
[Extract] is the data item
Title: Re: WTD
Post by: BigChris on 13 Jun 2014 06:12:31 AM
So do you need something along the lines of...

Filter:  extract(month;cast([Invoice Date (Inv)];date)) = (extract(month;current_date)) AND extract(week;cast([Invoice Date (Inv)];date)) = (extract(week;current_date))

I don't use extract myself, but i'd have thought that that would work...
Title: Re: WTD
Post by: dollipi on 13 Jun 2014 06:28:32 AM
I thought it too, but unfortunately no.

But should you have another proposal (without extract), I would be very thankful...

Title: Re: WTD
Post by: BigChris on 13 Jun 2014 08:29:16 AM
Ok...how about something like:

[Invoice Date(Inv)] >= _add_days(getdate(),_day_of_week(getdate(),1)*-1)

You might need to play around with the _day_of_week function to get the right start of your week, but that should give you something close to the answer.
Title: WTD
Post by: Cognos.Developer on 16 Jun 2014 12:21:02 AM
Hi Friends,

I thought the following link may help to solve this query.

http://www.forumtopics.com/busobj/viewtopic.php?t=196432&view=next&sid=d62ce7620be9f57299f719600f2e56d5


Thanks
Kumar