COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: cognos05 on 18 Feb 2021 09:33:54 AM

Title: detail laggregation
Post by: cognos05 on 18 Feb 2021 09:33:54 AM
this is might be a very basic question

I have a table like

Usrname Type
Abc         Analysis
Abc         Analysis
Abc         Analysis
Abc         No Report
Abc         No Report


Now i create a list and goup by user name and now i wanted to count the number of analysis entry for him

so I creae a data item saying
case
when  Type='Analysis'
then 1
Else 0
End

So the result i get is

UserName Count

Abc    1


Also when I make the calculated items default aggreagtion as total

Username  Count
Abc            3

Doesnt cognos aggreagte by default .
since i am doin a group by shoul i tell how  i should agregate this measure ? how is it showing 1 when i dont specify anything and leave it as default.


Title: Re: detail laggregation
Post by: adam_mc on 18 Feb 2021 09:47:59 AM
Try setting the detail aggregation of your calculation to be "Total".

Hope this helps,
Adam.
Title: Re: detail laggregation
Post by: bus_pass_man on 18 Feb 2021 01:47:44 PM

It is always better to do your modelling in the modelling tools.

Aggregation also depends on the usage of the object. 

If you modelled the expression in whatever modelling tool (FM or data module) which you should be using then you have greater control over them, including the timing of aggregation of query items in an expression.  You can then use the report studio settings to extend and augment what you have modelled.

If you have the usage set to measure and aggregation to total then your expression will execute exactly as you want.

If you have the usage set to attribute then you will get the result which you reported.

If you want to model this expression in your report, where it will not be available to any other report, then you would need to set the data item / detail aggregation setting to total.