SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 Group by day of the week (Thursday)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Dedancey
Starting Member

United Kingdom
1 Posts

Posted - 01/15/2013 :  11:26:24  Show Profile  Reply with Quote
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 - 02/26/2013 :  02:53:18  Show Profile  Reply with Quote
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

India
52309 Posts

Posted - 02/26/2013 :  03:48:16  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000