COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: PRIT AMRIT on 24 Jan 2011 03:13:38 AM

Title: Enabling 'Cross Product Allowed' option in Query!
Post by: PRIT AMRIT on 24 Jan 2011 03:13:38 AM
Hi Gurus,

Require your valuable suggestions in the below scenario.

I have a Report, which is working fine now. But as per the 'Business' requirement got to add an additional filter for 'fiscal year'.

The value for this 'fiscal year' comes from another table. This table will always have 1 value, e.g. now it has FY=2011.

To be able to filter the existing report, I have to make a join between these tables and which i don't want, since there are lot of queries and calculation in the existing query. If i apply the join then have to change Queries and map report to the latest query after join.

Instead, can I just enable the 'Cross Product Allowed' option in the query and straight away filter the report?

e.g. [Query 1].[Year]=[Query 2].[FY]

Let me know if any other work around as well.

Thanks a lot

Title: Re: Enabling 'Cross Product Allowed' option in Query!
Post by: FM on 24 Jan 2011 08:18:59 AM
You hardly ever want a cross join. A cross join will give you n*m where n is the number of tables and m is the number of rows per table. Now exactly what you want, eh?

How do that tables look from the database side? Also, if all we're talking about is year, why is it critical that it comes from query 2?

You're the report author, right? Filter on year, and to the consumer, it's the same, right? They'll get what they want with out horrid performance.

Or is there some specific reason you need to filter on Query 2?
Title: Re: Enabling 'Cross Product Allowed' option in Query!
Post by: PRIT AMRIT on 24 Jan 2011 08:18:27 PM
Looks like u didn't understand my post. Well, let me brief you little more.

Say I have a report and which is build on Query 'A'. This Query requires a filter for Fiscal Year. Of course Query 'A' has a 'Year' column.

For some typical business requirement we are calculating the 'Fiscal Year' and storing the value in another table 'B'. The table looks like,

sys_param_cd        sys_param_value
---------------      -----------------
Fiscal Year                  2011

Now, I should filter the Query 'A' based on this table 'B' value. Got it?

So, in Query 'A' the filter would look like

[Query A].[Year]=[Query B].[Fiscal Year]

But, when you would try to do this, you would see error message since there is no relationship between these two tables. I mean Query A and Query B.

I know, I can have a straight forward join between these 2 queries, but if i do so, i have to change the query structure and map the reports to the after join queries. Which i don't want since i have lot of queries and calculations.

But there is another option in Query Properties called 'Cross Product Allowed'. I wonder if i can just enable that option to 'YES' and they perform the FILTER, will it cost me any performance or other issues. Since the 'Query B' got only 1 record.

Or any other workaround can do this?

Thanks
Title: Re: Enabling 'Cross Product Allowed' option in Query!
Post by: nag.prasady@gmail.com on 24 Jan 2011 11:54:48 PM
Create Master detail relation ship between then and hide the master using box type none.It's idea only if it works let me know.
Regards,
Nagendra.
Title: Re: Enabling 'Cross Product Allowed' option in Query!
Post by: PRIT AMRIT on 26 Jan 2011 12:16:37 AM
Good idea and seems to be working fine.

Thanks mate