COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: emt3245 on 22 Sep 2016 03:29:57 PM

Title: Using Grouped Totals as a Single Field
Post by: emt3245 on 22 Sep 2016 03:29:57 PM
I have report that is grouped by academic subject then professor then professors salary along with courses taught by term:
American Studies  John Smith    $50,000      AS 1000-001     5
                                                                 AS 1000-002     10
Total                                                                                  15
                            Mary Jones    $40,000      AS 2000-001     1
                                                                 AS 2000-002     9
Total                                                                                  10
Total                                         $90,000                             25

That is how it should look but it is doubling the salary because technically the salary is on all the lines we are just grouping so it appears once.  How do I get the salary to total only once as opposed to however many lines there are.
Title: Re: Using Grouped Totals as a Single Field
Post by: tjohnson3050 on 22 Sep 2016 10:09:11 PM
Try changing the salary data item to a calculation that averages the salary records for the professor:

average([salary] for [professor])

Getting familiar with the 'for' argument increase your Cognos skills exponentially:

     ftp://public.dhe.ibm.com/software/dw/dm/cognos/reporting/advanced_report_design/using_the_at_and_for_options_with_relational_summary_functions.pdf