If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Two Subject Queries, Relationship Established, Counts Very High

Started by gosoccer, 09 Nov 2015 07:23:45 PM

Previous topic - Next topic

gosoccer

 ::)OK, this is strange, :o

I have two tables A and B,

I'm trying to build one Subject Query from these two tables without using UNION.

Both tables have unique IDs that I can match. I did the following but the counts under
TEST Framework Manager Subject Query rapidly increases to 2500 from 50.

1) Establish a 1-1 relationship between the two Subject Queries
2) Drag one of the columns that I need in my Report from Subject Q A to Subject Q B.
3) Go to Subject Q B (which includes the column from B) and Under the Test, Run Total Count.

The total count shows 2500 now.

Could someone please let me know what I'm doing wrong?

Thx so much in advance for your time. :) :)

MFGF

Quote from: gosoccer on 09 Nov 2015 07:23:45 PM
::)OK, this is strange, :o

I have two tables A and B,

I'm trying to build one Subject Query from these two tables without using UNION.

Both tables have unique IDs that I can match. I did the following but the counts under
TEST Framework Manager Subject Query rapidly increases to 2500 from 50.

1) Establish a 1-1 relationship between the two Subject Queries
2) Drag one of the columns that I need in my Report from Subject Q A to Subject Q B.
3) Go to Subject Q B (which includes the column from B) and Under the Test, Run Total Count.

The total count shows 2500 now.

Could someone please let me know what I'm doing wrong?

Thx so much in advance for your time. :) :)

How many rows are there in table A? How many in table B?

Have you created a new model query subject and are you populating this with items from the data source query subjects for A and B?

MF.
Meep!

gosoccer

Good question.

Table A has only 50 and table B only 10.

They both are Subject Queries based on an existing Physical Layer Model Queries.

So at first A at the Physical Layer (Namespace) is directly created from a Datasource and B the same.
Then A is created AGAIN based on the A from the Physical Layer under the Business Layer.

Of course, all model queries (Business Layer) are based on Datasource Queries at the Physical Layer are based on Datasource.

Thanks for your time.

bus_pass_man

I have some ideas about things to explore.

Just to confirm my understanding:

You have query subjects A and B in your physical layer. 

You have model query subjects A and B in your business layer.  Each one contains stuff from either A or B. 

You then added a query item from A to B. 

Which A and which B?  I'm assuming the model query subjects but I want to make sure.

Is that a correct understanding?

You created a relationship between the A and B.  Which A and which B?  I'm guessing the model query subjects. 

If A has 50 records and B has 10 why are you saying the relationship is 1.1?  Is it because A has 10 records whose key matches a record in B and also has 40 records whose key does not exist in B?

Is it possible that there is another relationship between the two query subjects somewhere else in the model?  It could be an indirect one (i.e. A to Q to Z to B).

Does the fact that 50*50 = 2500 strike you?

If you created the relationship in the physical layer what results do you get? 

If you removed from B the query item from A without modifying anything else, what results do you get?

What does the SQL look like in query information? 

My guess is that you've created the relationship in between the model query subjects in the business layer.  You can have that or the mix of stuff from A and B in the one query subject but not both.


gosoccer

WHOOM!! I think this could be the problem.

"If A has 50 records and B has 10 why are you saying the relationship is 1.1?  Is it because A has 10 records whose key matches a record in B and also has 40 records whose key does not exist in B?"

Or as you mentioned, there is another Relationship causing the issue.

I'll review it. I eliminated all other Subject Query Items except one Item and it was still doing the same. 

Thx for your recommendations and your time.  8)




gosoccer

This issue is resolved. I had other Relationships that were causing the issue. I created the same scenario on a separate Framework Model, and did have any problems. Thx for the reply.  :) :) 8) 8)