Calculations using numbers from different aggergate groups
Hello Everyone- I have a report that aggregates a count of students by campus location, Academic Year and Academic Term. For example, I would want to derive the difference between the number of students at each location for Spring and Summer terms. so then, for the first entry I would be subtracting 426 from 537 (the number of students enrolled in the EC-MO location for Summer and Spring terms, respectively, see table below). Incidentally, the table below is the actual output from the report as it stands now: Location Year-Term Students Credits Detail EC-MO 2011 - SPRING 537 6077 Click here to see detail for this year, term, & location JAX 2011 - SPRING 151 2027 Click here to see detail for this year, term, & location MO 2011 - SPRING 760 11737 Click here to see detail for this year, term, & location NB 2011 - SPRING 260 2913 Click here to see detail for this year, term, & location RTP 2011 - SPRING 500 5795 Click here to see detail for this year, term, & location SJ 2011 - SPRING 460 3727 Click here to see detail for this year, term, & location WA 2011 - SPRING 329 3815 Click here to see detail for this year, term, & location WATTS 2011 - SPRING 191 2752 Click here to see detail for this year, term, & location WM 2011 - SPRING 349 3998 Click here to see detail for this year, term, & location EC-MO 2011 - SUMMER 426 3683 Click here to see detail for this year, term, & location JAX 2011 - SUMMER 129 938 Click here to see detail for this year, term, & location MO 2011 - SUMMER 122 821 Click here to see detail for this year, term, & location NB 2011 - SUMMER 185 1429 Click here to see detail for this year, term, & location RTP 2011 - SUMMER 428 3222 Click here to see detail for this year, term, & location SJ 2011 - SUMMER 156 1040 Click here to see detail for this year, term, & location WA 2011 - SUMMER 293 2395 Click here to see detail for this year, term, & location WATTS 2011 - SUMMER 36 312 Click here to see detail for this year, term, & locati WM 2011 - SUMMER 294 2121 Click here to see detail for this year, term, & location Thanks in advance!
April 18th, 2011 11:12pm

Hi Kenmdavisjr, Based on your description, I would recommend you calculate the difference student number in query by using the self-join if possible. In the report level, if you are using Reporting Services 2008R2, we can also use the Lookup function to achieve this. For more information about Using Self-Joins, please refer to http://msdn.microsoft.com/en-us/library/ms177490.aspx About the Lookup Function, please refer to http://msdn.microsoft.com/en-us/library/ee210575.aspx Thanks, Tony Chain Tony Chain [MSFT] MSDN Community Support | Feedback to us Get or Request Code Sample from Microsoft Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
April 24th, 2011 10:47pm

Hi- Thanks! A recursive query on a view is exaclty the solution that I used. Thanks again! Ken
April 24th, 2011 11:09pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics