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)
Date Grouping
drusso17
I have a report that I run monthly to list all open workorders. I have it grouped by week, then by worker. I set the grouping for the date to use an interval of "week" with a range of 1 (so it will be 1 week intervals). Here's the issue: Let's say I specify 1/1/10 to 1/31/10 as my date range. The first "week" would be 1/1/10 to 1/7/10. However, if there aren't any open workorders until 1/5/10, the date that shows for that week grouping is 1/5/10, NOT the week starting date (or week ending date, either would be nice). Is there an easy way to fix this??
Here's a sample CURRENT output:
01/05/2010
JOHNSMITH OPEN TICKET#XXXXXX 01/05/2010
DAVIDJOHNSON OPEN TICKET#YYYYYY 01/07/2010
01/09/2010
JOHNSMITH OPEN TICKET#ABCXYZ 01/09/2010
DAVIDJOHNSON OPEN TICKET#XYZ123 01/10/2010
Here's what I'd LIKE to see:
01/01/2010
JOHNSMITH OPEN TICKET#XXXXXX 01/05/2010
DAVIDJOHNSON OPEN TICKET#YYYYYY 01/07/2010
01/08/2010
JOHNSMITH OPEN TICKET#ABCXYZ 01/09/2010
DAVIDJOHNSON OPEN TICKET#XYZ123 01/10/2010
Hopefully that makes sense! Any and all help is appreciated!!!
Find more posts tagged with
Comments
mwilliams
Hi drusso17,
You should be able to create a new binding to use in the group that displays the date you'd like it to display. You could use a switch statement based on the week to return the correct value, you could use an if/then statement in the same fashion, or you could create a little function that builds the correct date based on what week it is.
Hope this helps.
drusso17
Not quite sure what you mean. Could you possibly provide a short example? I'm relatively new to BIRT, but learning the ropes quite quickly!
mwilliams
drusso17,
Yes. What version of BIRT are you using?
drusso17
I am using BIRT 2.3.2 I believe
Hans_vd
Another solution would be to write a function in your SQL Server that returns the first day of the week based on a date parameter. You could then include a call to that function in your select statement and print that date instead of the actual workorder date.
Pretty sure you'll find such a function on the net somewhere...
mwilliams
drusso17,
Let me know if Hans_vd's solution above doesn't work for you. If not, I'll create that example.