Showing posts with label relationship. Show all posts
Showing posts with label relationship. Show all posts

Monday, March 19, 2012

diamension relationship

Hi

I have a diamension called 'mechanism of injury' and measure injurycount situated in the injury measure group.

I defined a relation between mechanism of them using the regular relationship connecting using the mechanismofinjuryid key in both tables (mechanismofinjury and injury). I tried to deploy the cube and it gave me the following error.

Errors in the OLAP storage engine: The attribute key cannot be found: ....

I changed the error handling of cube by right clicking on the cube and going to processes and then customising the error handling to ignore the error. Now i could deploy the cube but the injurycount measure is not showing up correct results.

Before defining the relationship between the diamension i was getting injurycount=2541 which was correct.

After defining relationship between the diamensions i am getting injurycount=2526

When i carefully looked at the injury table i found out that in injury table there are 15 (2541 - 2526) records with mechanismofinjuryid=NULL. It seems like the analysis services do not take these records into account while calculating the measures.

I don't understand how do i handle the nulls without changing the error handling options.

Any help would be greatly appreciated.

-padu.

One way to resolve this problem is to create a missing member in the dimension like MissingDimMember.

When you load the fact table you use this missing member for fact table records with missing dimension members or dimension members that are not found in the dimension table.

It is also possible to configure this solution directly in SSAS2005.

Have a look in BOL: Defining the Unknown Member and Null Processing Properties

HTH

Thomas Ivarsson

Sunday, March 11, 2012

Diagram one to one in 2005

How do you create a one to one relationship from the diagram in Sql Server
2005?
All the relationships I create between tables from the diagram tool, shows
the tables as one to many.
Thanks,
TomIf by one to one, you mean every row in Table A must have exactly one
corresponding row in Table B and every row in Table B must have exactly one
corresponding row in Table A, the way to do that is to make one table out of
those two tables. If there is some reason they cannot be one table, you
will have to enforce this by triggers and/or by maintaining these tables
with stored procedures.
If by one to one, you mean one to zero or one, that is, every row in Table A
has zero or one corresponding rows in Table B, but can't have more than one,
then create a normal foreign key relationship from Table B to Table A, and
then make the foreign key columns in Table B unique.
If you mean something else, please give us a description of what you want.
Tom
"tshad" <tshad@.dslextreme.com> wrote in message
news:OTuWc1HXIHA.5340@.TK2MSFTNGP06.phx.gbl...
> How do you create a one to one relationship from the diagram in Sql Server
> 2005?
> All the relationships I create between tables from the diagram tool, shows
> the tables as one to many.
> Thanks,
> Tom
>|||"Tom Cooper" <tomcooper@.comcast.no.spam.please.net> wrote in message
news:en3XUPIXIHA.4476@.TK2MSFTNGP06.phx.gbl...
> If by one to one, you mean every row in Table A must have exactly one
> corresponding row in Table B and every row in Table B must have exactly
> one corresponding row in Table A, the way to do that is to make one table
> out of those two tables. If there is some reason they cannot be one
> table, you will have to enforce this by triggers and/or by maintaining
> these tables with stored procedures.
Actually, that was how I had it - 1 table. But the customer wants to split
out the data that is specific to the entity. Another reason is that there
are many large fields that are mainly comments and that could potentially
make a row 10K.
> If by one to one, you mean one to zero or one, that is, every row in Table
> A has zero or one corresponding rows in Table B, but can't have more than
> one, then create a normal foreign key relationship from Table B to Table
> A, and then make the foreign key columns in Table B unique.
No I mean one to one. But I would have the same problem if I was using zero
to one.
How do I do that from the wizards?
The value in the foreign table is not a key just a value. It has another
primary key for the table.
In EM it shows the relationship between the tables using this field. Do I
explicitly need to make this a key in EM?
Thanks,
Tom
> If you mean something else, please give us a description of what you want.
> Tom
> "tshad" <tshad@.dslextreme.com> wrote in message
> news:OTuWc1HXIHA.5340@.TK2MSFTNGP06.phx.gbl...
>> How do you create a one to one relationship from the diagram in Sql
>> Server 2005?
>> All the relationships I create between tables from the diagram tool,
>> shows the tables as one to many.
>> Thanks,
>> Tom
>