COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: FirstStruck on 01 Apr 2012 12:08:43 PM

Title: Counts after filtering not working properly
Post by: FirstStruck on 01 Apr 2012 12:08:43 PM
Hello,

I made a after auto-aggregation filter to exclude listing people with total hours of less than 10. The list works perfect. It leaves off the names of the 15 people who had less than 10 hours.

I also made another list, using the same query, to count the number of names.

Problem: it is returning the number of names as if the filter for 10 hours is not there. Even though it's actually listing 150 names with more than 10 hours, the count(Employee Name) function is still displaying 165, instead of 150.

Anyone know what I'm doing wrong?

Thanks for your help & suggestions.
Title: Re: Counts after filtering not working properly
Post by: blom0344 on 01 Apr 2012 02:50:20 PM
The after aggregation filter evaluates the results from the query row by row and suppresses the ones that do not qualify.  Performing a count will be done within the query prior to applying the filter , hence the 165 (instead of 150)

You should use the original query as input for a second one where you perform a distinct count on the employee id of the original query to get the proper results.
Title: Re: Counts after filtering not working properly
Post by: FirstStruck on 01 Apr 2012 09:11:11 PM
Quote from: blom0344 on 01 Apr 2012 02:50:20 PM
The after aggregation filter evaluates the results from the query row by row and suppresses the ones that do not qualify.  Performing a count will be done within the query prior to applying the filter , hence the 165 (instead of 150)

You should use the original query as input for a second one where you perform a distinct count on the employee id of the original query to get the proper results.

Thanks for your reply Blom0344!

I understand your first paragraph about the after auto aggregate function.

However, I am not sure how to go about using the original query as input for another. Could you please explain how this is done?

Thanks again!
Title: Re: Counts after filtering not working properly
Post by: blom0344 on 02 Apr 2012 01:25:08 AM
Create a second query by dragging it into the gui. Drag the first query to the right of the second one. An arrow will appear from right to left between the 2.  The original query will be displayed as a query reference to the right of the new query