COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: ey on 15 Mar 2007 09:46:45 AM

Title: Report Studio- can we insert different calculations for each row of a column?
Post by: ey on 15 Mar 2007 09:46:45 AM
In Report Studio, is it possible to insert different calculations for each row of a particular column?Ã, 
We have tried query calculations and data items. Thanks for any help.
Title: Re: Report Studio- can we insert different calculations for each row of a column?
Post by: MFGF on 16 Mar 2007 10:04:28 AM
Hi,

No - your calculations will apply to all rows.  You can achieve something similar by coding a calculation using an if/then/else construct or a case statement to do different things for different rows.  Will this give you what you need?

Regards,

MF.
Title: Re: Report Studio- can we insert different calculations for each row of a column?
Post by: ey on 20 Mar 2007 09:53:40 AM
This is very helpful, thank you.

If I am using an If/then or a case statement how do I reference what I want - e.g., not just a particular column, but also a particular cell (row/column combination).

I have measures on the rows, with time periods and calculations on the columns.
Title: Re: Report Studio- can we insert different calculations for each row of a column?
Post by: Cognerd on 20 Mar 2007 02:25:37 PM
Hi,

You might try to put the different calculations into your query, and then conditionally show the value from a particular one based on your logic.

Title: Re: Report Studio- can we insert different calculations for each row of a column?
Post by: kmuller on 21 Mar 2007 11:44:04 AM
Have you tried unlocking your cells and dragging the calcs in to that unlocked field.  Not sure if it will work, but it may be worth a try.

-k
Title: Re: Report Studio- can we insert different calculations for each row of a column?
Post by: ey on 21 Mar 2007 03:47:01 PM
We have tried unlocking and then dragging in a data item with calc; we also tried copying in a query calc. In the design page it looks like it will work, but then we get blank cells.
Title: Re: Report Studio- can we insert different calculations for each row of a column
Post by: jiunshen on 22 Mar 2007 04:14:14 PM
for my experience, I will use several list tables to do the different calculation in row level. So each list table will only show one row and the report will be combined by several list tables.

hope this answer your question,

jiunshen
Title: Re: Report Studio- can we insert different calculations for each row of a column?
Post by: Veekaygee on 23 Mar 2007 09:04:28 AM
I agree with jiunshen. Unless you have a definite criteria which can be coded in to a condition, multiple lists will be the answer. You will need quite a bit of formatting to make the lists look like one list.
Title: Re: Report Studio- can we insert different calculations for each row of a column?
Post by: almeids on 11 Apr 2007 02:42:33 PM
Probably too late to be of any help here, and I should confess I don't understand the original issue and am not running Cognos 8 yet, but Veekaygee's last comment prompted me: in the past I have attempted "quite a bit of formatting" to make multiple lists look like one, and I found it vastly preferable to make multiple result sets look like one, by unioning them, and maintaining a single list instead.
Title: Re: Report Studio- can we insert different calculations for each row of a column?
Post by: ey on 12 Apr 2007 10:02:25 AM
Thank you for the reply - we are still working on this issue.

Would you expand on the preferred approach that you have mentioned?
Title: Re: Report Studio- can we insert different calculations for each row of a column?
Post by: almeids on 12 Apr 2007 10:58:43 AM
Sure, but you'll need to translate from Reportnet concepts to Cognos 8...
Get your queries (actually, the Cognos 8 equivalent of their Tabular Models if there is one) similarly shaped, with the same number/type/order of data items.  This shouldn't be difficult if they were a single query to begin with, though if you have intermediate calculation data items in the tabular data you may have to add some dummy items to one or the other to make the result sets' layouts match.  Once you've done that, create the Cognos 8 equivalent of a UNION tabular set to merge the result sets in a single query which will supply the data to your list.

In ReportNet, assuming Query 1 and Query 2 displayed in List 1 and similarly formatted List 2, the specific steps would be:
- cut Query 1's Tabular Model
- drag a Tabular Set into Query 1
- paste Query 1's Tabular Model you cut into the Tabular Set (left)
- cut Query 2's Tabular Model
- paste Query 2's Tabular Model into the Tabular Set (right)
- Delete Query 2 and List 2

You would need to repeat/nest unions for each differently-calculated row you want to put together (expanding the Reportnet example, Tabular Set 1 would contain Tabular Model 1 and Tabular Set 2, which would contain Tabular Model 2 and Tabular Set 3, which would contain Tabular Model 3... etc.)

HTH
Steve
Title: Re: Report Studio- can we insert different calculations for each row of a column?
Post by: ey on 24 Apr 2007 03:58:04 PM
We'll try that and keep you posted, thanks!