COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Framework Manager => Topic started by: Rajeev on 26 May 2020 09:32:37 AM

Title: How to do and include a group by aggregate measure query item
Post by: Rajeev on 26 May 2020 09:32:37 AM
I have a query subject Allocated Budget at Activity Level.

The grain of this query subject is Dept-Section, Fiscal Year, and Activity Type.
I want to add a measure <Total Allocated Fiscal Year Section Budget> to this query subject.  This measure is suppose to show the total sum of all the <Allocated Amount> for it's associated Dept-Section and Fiscal Year for each row displayed by this query subject.  (Please see attached Image for more context).

I am fairly new to FM and I don't know where to start on this or not sure if this even possible in FM.


Title: Re: How to do and include a group by aggregate measure query item
Post by: bus_pass_man on 26 May 2020 03:08:41 PM
If  you add For dept-section to the measure's expression do you get what you want?
Title: Re: How to do and include a group by aggregate measure query item
Post by: Rajeev on 27 May 2020 07:16:06 AM
Yes, If I  add Dept-Section and Fiscal Year to the expression.
Title: Re: How to do and include a group by aggregate measure query item
Post by: bus_pass_man on 27 May 2020 08:23:08 AM
Another parameter that for can use is report, which gives some flexibility to the expression.
Title: Re: How to do and include a group by aggregate measure query item
Post by: Rajeev on 29 May 2020 04:37:49 AM
It worked.  However when I used report as the parameter it worked but the aggregated value was summing all the rows.

So in my query item expression, I used the dept-section and fiscal year as the parameters instead of report  and it gave me the expected results.
Aggregate(Allocated Amount for Dept-Section, Fiscal Year)


Thank you for the help.