The community of Analytics developers are invited to follow and participate in the developer network.
OpenText technical experts collaborate with supported customers and partners in the Magellan product area.

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.

var cy = BirtDateTime.year(;
var py = BirtDateTime.year(;
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 (params["Year"].value == 'Previous Year')

Please suggest me if I'm doing anything wrong here.


  • Try changing var b to:
    var b = Formatter.format(row["triTask__triWorkTask____triPlannedStartDT"],"yyyy-MM-dd");

    It would also be good to check row["triTask__triWorkTask____triPlannedStartDT"] for nulls.

    Jeff F.
    Sr. Technical Support Specialist
  • you  can also filter query on data set directly 
    select * from employee where department=DEPARTMENT
    replace this DEPARTMENT on dataSet beforeOpen at Script
Sign In or Register to comment.