Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 Group by day of the week (Thursday)

Author  Topic 

Dedancey
Starting Member

1 Post

Posted - 2013-01-15 : 11:26:24
Hello,

I'm new to reporting services and new to the forum so apologies if the question is in the wrong place!

I'm using report builder 3.0 and I'm trying to group my data based on a calculated field, but the code I have doesn't do what I want it to do:-

=DateAdd("d", 5- DatePart("w",Fields!ResolvedDate.Value),Fields!ResolvedDate.Value)

It is grouping by the Thursday dates within the parameters (ie 20th dec, 27th Dec, 3rd Jan) but when I drill down what it is actually doing is including dates for Sun through Sat rather than Thurs through Wed.

Any help is greatly appreciated

AnalystBrown
Starting Member

7 Posts

Posted - 2013-02-26 : 02:53:18
Since report builder 3.0 is not working, I suggest you try esCalc. It's simple to achieve what you want.
First, export data to esCalc from your database.Let's suppose the column A is Date.
Second, write expression in cell B2: =day@w(A2). This formula calculate the days of the week. Notice that you don't need write expression in other cells of B column, because this tool will automatically calculate for you.
Third, write formula in C3: =if(B3==4,C2+1,C2). Then group number appeared.
At last, group by this number, you'll get what you want.You can download this tool for a try: http://www.raqsoft.com/download.html
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-26 : 03:48:16
quote:
Originally posted by Dedancey

Hello,

I'm new to reporting services and new to the forum so apologies if the question is in the wrong place!

I'm using report builder 3.0 and I'm trying to group my data based on a calculated field, but the code I have doesn't do what I want it to do:-

=DateAdd("d", 5- DatePart("w",Fields!ResolvedDate.Value),Fields!ResolvedDate.Value)

It is grouping by the Thursday dates within the parameters (ie 20th dec, 27th Dec, 3rd Jan) but when I drill down what it is actually doing is including dates for Sun through Sat rather than Thurs through Wed.

Any help is greatly appreciated


whats expression used for passing value in drilldown?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -