COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognosdelaware on 04 Aug 2017 10:54:10 AM

Title: Does Cognos apply filters before or after retrieving data?
Post by: cognosdelaware on 04 Aug 2017 10:54:10 AM
I had a question about Cognos and filters.

Does Cognos pull back all the data from the database/table and then apply filters to the data OR are the filters applied at a database/table level and the filtered records returned to Cognos?

Thank you
Title: Re: Does Cognos apply filters before or after retrieving data?
Post by: Naveen nani01 on 04 Aug 2017 10:57:03 AM
Yeah

Sent from my Lenovo K50a40 using Tapatalk

Title: Re: Does Cognos apply filters before or after retrieving data?
Post by: Naveen nani01 on 04 Aug 2017 10:58:54 AM
By using aggregations on filters after or before aggregations we will filter the date by using some queries

Sent from my Lenovo K50a40 using Tapatalk

Title: Re: Does Cognos apply filters before or after retrieving data?
Post by: MFGF on 04 Aug 2017 11:05:19 AM
Quote from: cognosdelaware on 04 Aug 2017 10:54:10 AM
I had a question about Cognos and filters.

Does Cognos pull back all the data from the database/table and then apply filters to the data OR are the filters applied at a database/table level and the filtered records returned to Cognos?

Thank you

Hi,

The answer is either of those might happen, depending how you are filtering and how the report is written. In most cases, the query engine can figure out how to take your filters and write a database query to include them, thereby getting the database to apply the filters and return a filtered result set. In some cases this isn't possible, though - for example if you are reporting over multiple data sources and you have a filter comparing a value from one data source with a value from the other. If you're unsure, take a look at the generated SQL (the Native SQL) and you should see if the appropriate predicate(s) is/are included.

Cheers!

MF.
Title: Re: Does Cognos apply filters before or after retrieving data?
Post by: cognosdelaware on 04 Aug 2017 11:06:56 AM
My question was, if I have a filter on my data, does the filter get applied at the database level BEFORE the data is returned to Cognos OR does ALL the data come back from the database and then Cognos applys the filters?
Title: Re: Does Cognos apply filters before or after retrieving data?
Post by: Lynn on 07 Aug 2017 01:57:51 AM
Quote from: cognosdelaware on 04 Aug 2017 11:06:56 AM
My question was, if I have a filter on my data, does the filter get applied at the database level BEFORE the data is returned to Cognos OR does ALL the data come back from the database and then Cognos applys the filters?

MFGF answered your question quite clearly I thought. Did you see that response?
Title: Re: Does Cognos apply filters before or after retrieving data?
Post by: Invisi on 17 Aug 2017 04:48:18 AM
Perhaps you mean before or after the aggregation result? This is a parameter you can set for the filter. By default the filter is applied before aggregation, so like a regular where. So if you want to have the filter work on your result (after aggregation), you must change the parameter.