Am doing a full outer join on 2 tables A and B on column "id" in Cognos report studio. Both tables have multiple records for id column. My requirement is I have to count number of records from each table and show it on a graph. But when I count records, it is multiplying the records and resulting in cartesian product.
A.id ---- B.id
1 ------ 1
2 ------ 2
2 ------ 2
3 ------ 4
4 ------ 5
5 ------ 6
When I do a count this is what I get:
A.id ---- B.id ---- Count(A.id)---- Count(B.id)
1 ---- 1 ---- 1 ---- 1
2 ---- 2 ---- 4 ---- 4 (Am expecting 2 for these kind of records)
3 ---- null ---- 1 ---- null
4 ---- 4 ---- 1---- 1
5 ---- 5 ---- 1 ---- 1
null ---- 6 ---- null ---- 1
I need to present the total number of records from table A and from Table B in a graph. Since this is resulting in cross product, graph values are not giving correct results.Can any one suggest how to avoid this cartesian product for the 2nd record? Please suggest if this is possible or not?