COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: bje on 11 Jan 2008 07:28:03 AM

Title: How to effect granularity of calculations & sums
Post by: bje on 11 Jan 2008 07:28:03 AM
So far I have been able to have one query select items from another query performing calculations on the item.  However I realized a problem is lurking here.  I am not sure of the mechanism to force the calculation not on the entire set of data but on just the rows belonging to an individual agent.  Within SQL I would accomplish this with a 'Group By AgentID'. How do I effect this in Report Studio ? Group/Ungroup seems more about not repeating 'duplicates' in the output. The List property Grouping & Sorting seems to come after the queries are run which makes me think its not the right place either.

Thanks
Title: Re: How to effect granularity of calculations & sums
Post by: bje on 12 Jan 2008 11:18:39 AM
I think this answers my question:

for
Use with summary expressions to define the scope of the aggregation in the query.

Syntax
aggregate_function ( expression FOR expression { , expression } )