Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Start week-of-year on Monday
enuite
I'm designing some reports using datacubes and crosstabs. I have groups based off of week-of-year and day-of-year. The problem is these groups are grouping weeks as "Sunday-Saturday", but our company's reporting is all "Monday-Sunday" numbers.
I've hunted around and cannot for the life of me find a way to adjust this in datacube grouping.
Any tips would be greatly appreciated.
Thanks,
Ezra
Find more posts tagged with
Comments
mwilliams
Hi Ezra,
You could create computed columns in your dataSet to create a custom group field for week of year and use this field in your dataCube.
CBR
Just a hint of how to realize mwilliams suggestion:
in initialize event handler of the report add following snippet:
importPackage(Packages.java.util);
calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
Add a computed column to your dataset. I assume that your database column containing a date value is called "time".
To compute the column add following snippet:
calendar.setTime(dataSetRow["time"]);
calendar.get(Calendar.WEEK_OF_YEAR);
hope this helps
enuite
Thanks for the advice. I had done something similar to the first recommendation using table groups, but it didn't occur to me to use computed columns to get around the datacube limitations.
The second solution seems even easier if it plays nice. I'm new to BIRT and have only begun to play around with scripting. Could either of you point me to a good resource online laying out the APIs for the various report objects?
Thanks again, you've been really helpful.
Ezra