COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Query Studio => Topic started by: mrl72 on 21 May 2014 03:48:53 PM

Title: Last number of days feature not creating filter in where clause
Post by: mrl72 on 21 May 2014 03:48:53 PM
When using date filters in a query there is an option to filter on "Last number of days". Has anyone noticed that when it creates the query it doesn't pass the date filter to the database, it applies it using a Cognos function after the data is returned and thus performance is terrible?

The reason being Cognos uses the _add_days function, which is a Cognos function. Example: Transaction_date >= _add_days(current_date,(-(1 * 40))) (last 40 days).  And it simply doesn't add it to the outgoing SQL query.                                     

But what's strange is that it converts the _add_days function to a DB equivalent function as a column in the same SQL, so why isn't it passing it to the where clause in the same SQL? Example: select  "Transaction_date", ( current_date + cast( (   
-40 ) as INTERVAL DAY(4)))

Anyone seen this before?

Cheers.