COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: iBoy on 22 Apr 2014 07:42:19 AM

Title: Basic Aggregation Understanding
Post by: iBoy on 22 Apr 2014 07:42:19 AM
Hi Cognoise people!

I have a fairly simple request, I think.

A report currently performs an aggregation like so:

(aggregate([Count] within set [LatestTimeDimension]))

This gives the sum of a measure called Count against the latest Time Dimension member in the context of the report.

All works fine...


Now I want to filter this aggregation by another dimension (on a particular member, called [New]) - I keep expecting a simple change is needed but I cannot identify how based on what I've read.

I tried the simple approach like so:

(aggregate([Count] within set ([LatestTimeDimension],[New])))

I'm aware this won't work as a "Set" function doesn't allow two different dimensions within it, but hopefully this gives the technical idea what I'm trying to achieve.

All help is welcomed!

Regards,
iBoy
Title: Re: Basic Aggregation Understanding
Post by: MFGF on 22 Apr 2014 12:42:11 PM
Quote from: iBoy on 22 Apr 2014 07:42:19 AM
Hi Cognoise people!

I have a fairly simple request, I think.

A report currently performs an aggregation like so:

(aggregate([Count] within set [LatestTimeDimension]))

This gives the sum of a measure called Count against the latest Time Dimension member in the context of the report.

All works fine...


Now I want to filter this aggregation by another dimension (on a particular member, called [New]) - I keep expecting a simple change is needed but I cannot identify how based on what I've read.

I tried the simple approach like so:

(aggregate([Count] within set ([LatestTimeDimension],[New])))

I'm aware this won't work as a "Set" function doesn't allow two different dimensions within it, but hopefully this gives the technical idea what I'm trying to achieve.

All help is welcomed!

Regards,
iBoy

You're so close!!

The key piece you're missing is a tuple - a tuple is the value at the intersection of members. Try this:

aggregate(tuple([New],[Count]) within set [LatestTimeDimension])

This assumes [New] is a member...

Cheers!

MF.