Not able to Filter the Report Data based on Year
I need to filter the report data in BIRT based on the year selected in the report parameter. If I select 'Current Year' from the parameter, it should only return me the data for 2020 year and not previous year.
Please find the attach screenshot for the report result I'm getting. I have applied the filter for 'Planned Start' field to check if it's for current year. Please find the below condition that I have written for filtering on dataset.
Please suggest me if I'm doing anything wrong here.
Please find the attach screenshot for the report result I'm getting. I have applied the filter for 'Planned Start' field to check if it's for current year. Please find the below condition that I have written for filtering on dataset.
var cy = BirtDateTime.year(BirtDateTime.today());
var py = BirtDateTime.year(BirtDateTime.today())-1;
var c = row["triTask__triWorkTask____triPlannedStartDT"];
var b = new Date(Formatter.format(row["triTask__triWorkTask____triPlannedStartDT"],"dd/mm/yyyy"));
var a = BirtDateTime.year(b);
if (params["Year"].value == 'Current Year')
{
if(a==cy)
{true}
}
if (params["Year"].value == 'Previous Year')
{
if(a==py)
{true}
}
Please suggest me if I'm doing anything wrong here.
0
Comments
-
you can also filter query on data set directly
select * from employee where department=DEPARTMENT
replace this DEPARTMENT on dataSet beforeOpen at Script0
Categories
- All Categories
- 108 Developer Announcements
- 53 Articles
- 106 General Questions
- 144 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 899 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 120 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management