Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Problem with date format in aggregate filter
Tubal
I'm trying to filter an aggregate based on a date range, but the date format seems to be hanging it up.
Basically I have a table of invoices, with a date, dollar amount, etc.
I'm trying to create several aggregates where I say total $ for the last 60 days, total $ for the last 30 days, etc.
I can format the table cell so the date is in mm/dd/yyyy format without any problems. I can filter the entire table by date without any problems.
The problem happens when I try to use the date in the filter expression in the aggregate. The date is being passed from an SQL query and is passed in the format YYYY-MM-DD.
When I put the filter in the aggregate expression, it doesn't like the format.
If I do something along the lines of:
row["date"] > BirtDateTime.today() - 60
or
row["date"] > BirtDateTime.addDay(BirtDateTime.today(),-60))
it leaves the aggregate blank.
row["date"] > '9/9/11' leaves the aggregate blank.
row["date"] > '2011-09-09' works like it should.
Any help would be appreciated.
Find more posts tagged with
Comments
Tubal
Figured it out.
I did:
row["date"] < Formatter.format(BirtDateTime.addDay(BirtDateTime.today(),-60), "YYYY-MM-d")
Thanks.
mwilliams
Glad you found a solution! Let us know whenever you have questions or issues!