Sunday, January 26, 2014

A loop involving the member with the key [no.], was detected in the parent-child relationship between the attribute [child_id] and the attribute [parent_id].

As the error implies there is a loop in the parent-child hierarchy in one of the dimensions you are trying to process. For example if you have an Employee dimension and there is a parent-child relationship between employee_id and supervisor_id attributes, having this error means that you have in your source table _for example_ Ali as a supervisor for John but in another record John is ALSO the supervisor of Ali!.

To find such loop run the following query on your source table:

select * from      tableName tl1
         left join tableName tl2
         on tl1.child_id = tl2.parent_id
where tl1.parent_id = tl2.child_id

1 comment: