|
Re: Get the Sundays ( dates) from a date range [message #724568 is a reply to message #723933] |
Mon, 12 September 2011 15:07 |
|
Why not use the birtdatetime functions available in the expression
builder to add a computed column for week (1-52) and group on that?
Look at the two computed columns in the attached report.
Jason
On 9/9/2011 6:25 PM, KK wrote:
> I am looking to get all the sundays(the dates ex: 9/11/2011, 9/18/2011
> etc) between a date range (ex: 09/01/2011 - 09/30/2011). I then want to
> group the report by this so I can aggregate the data for the week.
> Please advise.
>
-
Attachment: weekday.zip
(Size: 2.14KB, Downloaded 211 times)
|
|
|
|
|
Re: Get the Sundays ( dates) from a date range [message #730077 is a reply to message #729749] |
Tue, 27 September 2011 15:22 |
|
You can always create a computed column using a Java util calendar like:
importPackage(Packages.java.util);
cl = new GregorianCalendar();
cl.setTime(row["ORDERDATE"]);
cl.setFirstDayOfWeek(Calendar.MONDAY);
cl.get(Calendar.WEEK_OF_YEAR);
You can set the first day of the week to whatever you want then drag the
dataset onto the report, group by week and put an aggregation element in
the group footer. Select the detail row and delete it.
Jason
On 9/26/2011 6:06 PM, KK wrote:
> Hi Jason,
> This does not work in my case...since I need to aggregate all amounts
> for week ending Sunday(including sunday)...every sunday. I just need to
> show the aggregated value and dont need to show the detail amounts for
> the rest of the week.
> I tried your calculated column but when I grouped by it...it groups by
> all Sundays...and week number starts a new week on Sunday so misses out
> on Sunday values. please advise.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03036 seconds