Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Connecting a Dim to a Fact 2 or more times.

Can someone help me with the best way to associate a Dim to a fact more than once.

My example would be this....

Fact

Resource_Surrogate_ID

Manager_Surrogate_ID

EE DIM

Resource_Surrogate_ID

In this situation the resource has an ID in the Fact as well as an ID for that resources Manager. Both are Employees of the company and reside in the EE DIM.

In SQL I would just join to the EE table twice with an alias.

How do I best handle this in QlikView ?

Any help would be much appreciated.

Thanks,

Ben

2 Replies
Gysbert_Wassenaar

Depends on the kind of analysis you need to do. What kind of analyses are you going to do based on the managers? Are only the names going to be used or are you going to analyse managers by for example age group, income group or other attributes of the manager entity?

If not you could use a mapping table and applymap to replace the manager_surrogate_id with the managers name in the fact table. You wouldn't need a separate managers dimension table then.

If you do need to do analyses on attributes of managers then load the employee dimension twice, once as Employee dimension and once as Manager dimension. The two dimension tables should only be linked to the fact table, not to each other.

For the relations between employees and managers you can use the hierarchy and hierarchybelongsto functions to create a table that includes the hierarchical information about managers and employees.


talk is cheap, supply exceeds demand
Not applicable
Author

Gysbert,

Thanks for the help with this. I basically took the second approach you mention but rather than doing a true load I did a "Resident Load" of the EE table and made it the Manager table. Both are linked to just the fact table like you suggested. Is a Resident load a good way to do that ? My thinking is that it would be more efficient... but I'm new at this so I'm not confident of that. Would like others opinion.

Also... I put an "Inner Keep" before my DIM loads so that, I think, it will only bring in the DIM data if there is matching information in the fact. Is that a good practice ?

Thanks,

Ben