COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: BIsrik on 20 Feb 2006 12:57:10 AM

Title: [solved]Displaying values on a certain condition
Post by: BIsrik on 20 Feb 2006 12:57:10 AM
Hi,

I have a requirement, to display a column value in two columns based on certain creteria. For Eg.

I have a table ABC with four columns in it.

Col1Ã,  Ã,  Ã,  Ã,  Ã, Col2Ã,  Ã,  Ã,  Ã,  Ã,  Col3Ã,  Ã,  Ã,  Ã,  Ã, Col4
A1310Ã,  Ã,  Ã,  Ã,  Ã, 2Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  fÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 1
A1310Ã,  Ã,  Ã,  Ã,  Ã, 3Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  fÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 2
A1310Ã,  Ã,  Ã,  Ã,  Ã, 4Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  tÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 
A1320Ã,  Ã,  Ã,  Ã,  Ã, 2Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  t

I have to display the values in the report as:

TextAÃ,  Ã,  Ã,  Ã,  Ã, TextBÃ,  Ã,  Ã, TextCÃ,  Ã,  Ã,  Ã, 
A1310Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 3Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  4
A1320Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 2Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  2

In short, TextB column will have value from the col2 in the table where col3 is 'f' and maximum of col4 for that ticket. If observed for A1310 records in the table, Col3 has two records with 'f' as the value. Col4 has two values 1 and 2. Maximum of col4 is 2 and corresponding value in col2 is 3. This value must be displayed in the TextB column in the report.

TextC displays value of col2 in the table where col3 is 't'.

By enabling auto group and summarize to 'yes' it would take a lot a time as there are millions of records in the table. If set to 'No' gives the table values faster.

Any thoughts of how to do this...

Srik
Title: Re: Displaying values on a certain condition
Post by: BIsrik on 20 Feb 2006 09:57:36 AM
could get this done by using child tabular model.

Srik
Title: Re: [solved]Displaying values on a certain condition
Post by: cognosrebel on 21 Feb 2006 03:45:57 PM
How did you solve this? I tried it using a child tabular model also, using if conditions.

What ever logic i use I get empty colums.

Thanks
Title: Re: [solved]Displaying values on a certain condition
Post by: BIsrik on 22 Feb 2006 09:20:22 AM
I didn't use any if condition. I had a parent tabular model in which i inserted two child tabular models t1 and t2. In t2 i inserted one more child tabular model.

t1 gives me the results for col3 = t and t2 gives me col3 = f. Joined the results of both t1 and t2 in the parent tabular model.

Have no idea whether my approach will hit performance. Trying new ways also.

Srik