COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Sipo on 05 May 2014 08:57:03 AM

Title: calculation over 2 crosstables
Post by: Sipo on 05 May 2014 08:57:03 AM

How can I display a column as a percent over two crosstables?

example:
In  crosstable 1, we have a column "No. of flights" indicating the total flights in the period February 2014 (example: 1850 flights ).
In the second crosstable we have a calculated column that displays the flights in the period between February 2014 and with a delay code Xx (example: 5 flights). Now I want to display in the second crosstable the  flights "5" as a percentage.

Issue: I can not make a calculation on two crosstables. Have you perhaps a resolve?

I use the Report Studio v. 10.2.1


thank you!
Title: calculation over 2 crosstables
Post by: MFGF on 05 May 2014 03:39:06 PM
Are you using a dimensional or relational package? Do the two crosstabs share the same query in the report?

MF.


Sent from my iPad using Tapatalk HD
Title: Re: calculation over 2 crosstables
Post by: Sipo on 06 May 2014 01:43:03 AM
good morning MFGF,

we use a dynamic (dimension and measures) package that is based on a relation database. The queries of the crosstables are different. If i put the column fom first table into the secound... i will get the same measures. [Delay in %[(http://img5.fotos-hochladen.net/uploads/201405060821s0mv2zlbt.png) (http://www.fotos-hochladen.net)]

thank you
Title: Re: calculation over 2 crosstables
Post by: MFGF on 06 May 2014 08:59:24 AM
Quote from: Sipo on 06 May 2014 01:43:03 AM
good morning MFGF,

we use a dynamic (dimension and measures) package that is based on a relation database. The queries of the crosstables are different. If i put the column fom first table into the secound... i will get the same measures. [Delay in %[(http://img5.fotos-hochladen.net/uploads/201405060821s0mv2zlbt.png) (http://www.fotos-hochladen.net)]

thank you

If you're using a DMR package then you have all the nice dimensional functions available to you...

What do you see if you drag the No. of Flights column from your package as a new column into the second crosstab? Do you get the same values for each year?
If so you can then simply add a query calculation as a new column that divides Delay>0Min by No. of Flights then format as percentage?

If not, can you provide more detail on why this isn't possible?

Cheers!

MF.
Title: Re: calculation over 2 crosstables
Post by: Sipo on 07 May 2014 01:51:15 AM
Good morning,

I had already tried with the calculate task. If I put the No. of. flights into the secound crosstab then i get the same values (Delay>0Min == No. of flghts.)

But in the column of Delay>0Min there is also a query:

IF ([Delay departure (minutes)]>0)
THEN ([No. of flights])
ELSE (0)

Look at the rows "57", "61" and "81", these are Delay reasons. I have to disconnect the relation between the 57, 61, 81 and No. of flghts. Cause the No. of flights reference the same values like Delay>0Min.

[Percentage][/(http://img5.fotos-hochladen.net/uploads/20140507084m63apjw75z.png) (http://www.fotos-hochladen.net)]





Thank you for your help :-D
Title: Re: calculation over 2 crosstables
Post by: MFGF on 07 May 2014 08:31:14 AM
There must be something else going on here we're not seeing, otherwise the values would not be the same. Have you defined detail filters for this crosstab? Slicers?

MF.
Title: Re: calculation over 2 crosstables
Post by: Sipo on 09 May 2014 02:27:50 AM
Hello,

i defined just for the first crosstab (no. of flights). It delimits the flights for one airline. Maybe i have to bring the reports together?

help me please   :-[

Thx!