COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: fatnos on 08 Oct 2007 02:09:49 PM

Title: Help with Maximum Function
Post by: fatnos on 08 Oct 2007 02:09:49 PM
Hi-

I have a report that lists the 4 quarters of the year.  Each quarter is its own data item in the query.  I want to insert a data item in my crosstab that will give me the maximum for that row.  Example:




Q1Q2Q3Q4MAX
Row11020304040
Row21250403050

Any help is greatly appreciated.  Thanks to all....

Chris
Title: Re: Help with Maximum Function
Post by: DSR on 09 Oct 2007 01:45:04 AM
Try by using IF condition

The below code is need to take in one calculated dataitem

i.e
if (q1>q2) and (q1>q3) and q1>q4
then q1
else if q2>q1 and q2>q3 and q2>q4
then q2

else if q3>q1 and q3>q2 and q3>q4

then q3

else q4

here q1--> 1st dataitem
     q2--> 2nd data item
    ...........

I think this can help for ur question
if not just post it again.

Thanks
Sanjeev