COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: hespora on 13 Jul 2016 10:18:26 AM

Title: [solved] Deliberately setup a cross join?
Post by: hespora on 13 Jul 2016 10:18:26 AM
Hi,


So I have a query resulting in a low number of rows, let's say 3:

[q1].[col1]
1
2
3

another similar query with a low number of rows as well:

[q2].[col2]
A
B
C
D

what I need to create in RS is the cross join of these two, so in this case, a query with 12 resulting rows:

[q1].[col1]   [q2].[col2]
1                 A
1                 B
1                 C
1                 D
2                 A
2                 B
2                 C
2                 D
3                 A
3                 B
3                 C
3                 D

How do I actually achieve that? Creating a join without a link results in an error message "XQE-V5-0018 - expression for 'filterExpression' is empty"
Title: Re: Deliberately setup a cross join?
Post by: Lynn on 13 Jul 2016 10:26:33 AM
Add a dummy query item to both queries and join on that. For example, create a query item in query1 called Dummy and set the expression as some hard coded value like 'join'. Put the same query item in query2 and then use that column as the join.
Title: Re: Deliberately setup a cross join?
Post by: hespora on 13 Jul 2016 10:32:28 AM
Works beautifully, thanks!  :)