MDX for getting history based on last dimension characteristic for SCD.
Hi everyone,
I am implementing the cube and I run into a problem with slowly changing dimensions(SCD). I guess it might be resolved somehow with MDX, maybe you guys can help me to resolve it. The problem: I have SCD, say Policy with dimension attribute PolicyType. I have a measure, say NumberOfActivePolicies. To simplify, I have 1 policy in my dimension which was activated in January with PolicyType=’Simple policy’. In February policy was amended and PolicyType become ‘Advanced Policy’. When I browse my cube, I have NumberOfActivePolicies = 1 for PolicyType=’Simple policy’ and I have NumberOfActivePolicies = 0 for PolicyType = ‘Advanced Policy’. This result reflect exactly what I have in my fact table: 1 ‘Simple Policy’ was activated and 0 ‘Advanced Policies’ was activated. But this result does not reflect the business situation – after amendment I have 1 ‘Advanced Policy’ activated and 0 ‘Simple policy’ activated. And now the question: is that possible to count NumberOfActivePolicies not according to the facts, but according to the last dimension characteristic (I mean if I query the cube till January only, I have 1 ‘Simple policy’ and 0 ‘Advanced policy’, but if I query the cube till February I have 0 ‘Simple policy’ and 1 ‘Advanced policy’). How can I implement this logic?
Here is what I have approximately on data level:
DimPolicy:
DimPolicyId BusinessPolicyid PolicyType
100 1 Simple policy
101 1 Advanced policy
FactPolicy
Id DimPolicyId FactDate Activation
1000 100 jan 2010 1
1001 101 feb 2010 0
So if I just summarize all activations and group them by PolicyType I get wrong answer from business point of view
Thanks
Hi everyone,
I am implementing the cube and I run into a problem with slowly changing dimensions(SCD). I guess it might be resolved somehow with MDX, maybe you guys can help me to resolve it. The problem: I have SCD, say Policy with dimension attribute PolicyType. I have a measure, say NumberOfActivePolicies. To simplify, I have 1 policy in my dimension which was activated in January with PolicyType=’Simple policy’. In February policy was amended and PolicyType become ‘Advanced Policy’. When I browse my cube, I have NumberOfActivePolicies = 1 for PolicyType=’Simple policy’ and I have NumberOfActivePolicies = 0 for PolicyType = ‘Advanced Policy’. This result reflect exactly what I have in my fact table: 1 ‘Simple Policy’ was activated and 0 ‘Advanced Policies’ was activated. But this result does not reflect the business situation – after amendment I have 1 ‘Advanced Policy’ activated and 0 ‘Simple policy’ activated. And now the question: is that possible to count NumberOfActivePolicies not according to the facts, but according to the last dimension characteristic (I mean if I query the cube till January only, I have 1 ‘Simple policy’ and 0 ‘Advanced policy’, but if I query the cube till February I have 0 ‘Simple policy’ and 1 ‘Advanced policy’). How can I implement this logic?
Here is what I have approximately on data level:
DimPolicy:
DimPolicyId BusinessPolicyid PolicyType
100 1 Simple policy
101 1 Advanced policy
FactPolicy
Id DimPolicyId FactDate Activation
1000 100 jan 2010 1
1001 101 feb 2010 0
So if I just summarize all activations and group them by PolicyType I get wrong answer from business point of view
Thanks