If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Function mediane - first and third quartile

Started by tamise, 25 Apr 2015 08:04:09 AM

Previous topic - Next topic

tamise

Hello,

I need your help to figure out how i can get quartile of a list of values.

For exemple, I have the values :

100,200,300,300,400,500

I can i get the first quartile and the third quartile with report studio ?


For me, first quartile : 200 or 250 ( I do not very well)
third quartile (400 or 450)

Thank you for your help.

bdbits

You could use the quartile() function. I copied the following from the Tips tab in the Report Studio expression editor.

quartile ( numeric_expression [ at expression { , expression } ] [ <for-option> ] [ prefilter ] )
quartile (  numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Returns the rank of a value, represented as integers from 1 (highest) to 4 (lowest), relative to a group of values. The "<for-option>" defines the scope of the function. The "at" option defines the level of aggregation and can be used only in the context of relational datasources.

Example: quartile ( Qty )
Result: Returns the quantity and the quartile of the quantity value represented as integers from 1 (highest) to 4 (lowest).
Qty Quartile (Qty)
450 1
400 1
350 2
300 2
250 3
200 3
150 4
100 4

tamise

Thank you for your answer.

But this function do not return the value of the first quartile, it is just show the group of each value.
Because, for me i want to have :
first quartile = one value
third quartile = one value.

Is it even possible with cognos 8.3 ?

Thank you

bdbits

Add the quartile as a data item, then in your report use the normal aggregation expressions to get the min, max, average, median, or whatever it is you want for each quartile 'group'.