Extract Parent-Child from dimension
Hi all,
Is there a way to extract Parent-Child members in two columns using report script or any other way ?
We need to pull the extract from one outline and use that to build dimension in other outline.
I know I can use Essbase outline extractor utility, but I want to automate the regular work.
You can do that with the Outline Extractor. It will output each dimension into a separate file.
I do this on a daily basis. Batch script that is scheduled, runs outline extractor. Outputs text file for each dimension. Then those files are used in the build of other cubes.
In some cases I take it a step farther and have a vb script that will parse out pieces of dimensions and use those in the builld of other cubes. All scheduled/automated.
Other than that you could build your own custom vb api process to do it.
Or the Star Analytics product will do it.
And I am sure there are other ways that others may chime in with.
Similar Messages
-
OBIEE Parent-Child Dimension with multiple hierarchies
Is it possible to have in a parent-child dimension multiple hierarchies? I want to have the same botom childs to aggregate to different parrents. example.
Account Dimension
HR1-total
HR1-parrent1
CHILD1
HR1-parrent2
CHILD2
HR2-total
HR2-parrent1
CHILD1
CHILD2
Thanks in advance.No, it is not possible to have multiple hiearchies in a PC logical dimension.
The concept of the Parent-Child (PC) hierarchy is completely different from the level-based hierarchy. Specifically the PC hierarchy expects a predefined / architected table with corresponding PC column/value structuring with or without attributes.
Short story even shorter it is not possible.
Longer...
In the RPD the BMM actually prevents you from adding a new logical level, child level, or parent level when you have selected that the logical dimension be a parent child logical dimension with Parent-Child hierarchy.
On another note...
Have you tried architecting/building your PC source table so that it represents the roll-up and bottom child-levels like you are seeking? That is, that same member in the child column more than once having a separate parent value. That should be doable.
That was a great question, please award points if this answered your question or it was helpful.
Cheers,
Christian
http://www.artofbi.com -
Dynamic Security in a denormalized Parent-Child dimension Table
Hi guys, I need your priceless help again:
I have a parent child relationship in a table with a fixed depth, let´s say Region-->Area-->Country
I denormalized the table to have something like this
Then, to implement dynamic security, I think in a bridge table with the userId
and the CountryId, then with a measure group and a measure which count the combination of user/country I can proof the security using the non empty function.
My question is how can I also set security for the levels above the leaf members, let´s say, I want to assign an user to the Area level or Region Level. I don't know exactly which key could I include in the bridge table.
I may want to keep the id´s of the original table in the different levels.
Any comment will be appreciated.
Kind Regards,Hi Paul,
According to your description, you want to apply dynamic security on parent-child hierarchy. Right?
In Analysis Services, when a dimension contains a parent-child hierarchy, we can't set up security directly on the key attribute. Because it will not appear on the dropdown list of Dimension Data Security in Role editor.
In this scenario, we need to filter on key attribute and not the parent-child hierarchy. Then use Linkmember() to find the equivalent members on the parent-child hierarchy. Please refer to the expression below based on a employee dimension with parent-child
hierarchy.
Generate(
NonEmpty(
[Employee].[Employee].[Employee].Members,
[Measures].[Employee Count],
StrToMember('[User].[User].[' + UserName() + ']')
LinkMember(
[Employee].[Employee].CurrentMember,
[Employee].[Employees]
Also I suggest an excellent book:
Expert Cube Development with Microsoft SQL Server 2008 Analysis Services. It talks about this scenario in chap 9.
Reference:
SSAS
Dynamic security - Bridge table (factless) between User dimension and Parent-Child (PC) dimension
If you have any question, please feel free to ask.
Best Regards,
Simon Hou
TechNet Community Support -
OBIEE 11g Parent Child hierarchy
Hi,
I'm trying to setup a parent-child hierarchy dimension. I have setup a new hierarchy dimension using numeric keys but want to display another field in the hierarchical column on a report e.g. employee fullname & not the member_key based on a numeric value. Can this be done & how do you do it? All the examples I have seen use varchar2 type columns as the keys to do this.
Thanks in advance, Phil
My Setup
=============
Dimension - logical level
===============
member key = employee_id
parent-child table source
===============
member key = employee_id
parent key = supervisor_id
relationship distance = levels_removed
leaf node identifier = isleaf
Employee logical folder
==============
employee_id ( number)- primary key
full_name (varchar2) - unique key
supervisor_id ( number)
Closure table
=========
employee_id ( number)
supervisor_id ( number)
level ( number)
isleaf ( number)Thanks for the link Suresh but the aggregations are working correctly.
My problem is only at the display level. I need to create a dashboard that displays the complete hierarchy.
So for example if I have this hierarchy:
- Steven King
- Adam Frip
Alexis Bull
Anthony Cabrio
Alberto Erraruriz
Den Raphaely
I want the dashboard to display immediately that complete hierarchy. If someone adds a member to the hierarchy in the database, the dashboard should display this new member without having to manually modify the dashboard.
- Steven King
- Adam Frip
Alexis Bull
Anthony Cabrio
- Alberto Erraruriz
Mozhe Atkinson
Den Raphaely
Also, if I just manually open the hierarchy and save the dashboard, if "Steven King" is replaced by "Shanta Vollman", the dashboard doesn't like it and returns a result looking like:
- Adam Frip
Alexis Bull
Anthony Cabrio
- Alberto Erraruriz
Mozhe Atkinson
Den Raphaely
+ Shanta Vollman
So I'm looking for some option that will tell OBIEE to open the hierarchy without having to specify "Drill down on member "Steven King"", "Drill down on member "Adam Frip"...
I hope I'm explaining correctly... -
Extract the hierarchy in Parent child format from HP
Hello,
I have a hierarchy within Accounts dimension which I need to move to the other application in the different environment. I donot want to move the whole dimension. I just need to move a hierarchy. Is there a way I can extract a hierarchy in Parent child format with properties and move the same in to the next one.
Thanks in advance for your help.
Cheers,
XXXHi,
Below code assumes that you have 2 alias tables and assymetric hierarchy (having 4 to 6 levels) in accounts and all level 0 accounts are 6 digits. If you wish to remove the second alias table from the code simply remove references to it (i.e. aliastbl_id=50030). You can customize the extract top level member by modifying this section: (select object_id from hsp_object where object_name='Total Expenditure')
This outputs the structure in a fixed columnar format having all levels in different columns.
Code:
select o1.object_name as LVL1, o1.object_name as LVL1_DESC_EN, al1.object_name as LVL1_DESC_AR,
o2.object_name as LVL2, o2.object_name as LVL2_DESC_EN, al2.object_name as LVL2_DESC_AR,
o3.object_name as LVL3, al3.object_name as LVL3_DESC_EN, alar3.object_name as LVL3_DESC_AR,
o4.object_name as LVL4, al4.object_name as LVL4_DESC_EN, alar4.object_name as LVL4_DESC_AR,
o5.object_name as LVL5, al5.object_name as LVL5_DESC_EN, alar5.object_name as LVL5_DESC_AR,
o6.object_name as LVL6, al6.object_name as LVL6_DESC_EN, alar6.object_name as LVL6_DESC_AR
from hsp_object o1
left outer join (select * from hsp_alias where aliastbl_id=50030) a1 on o1.object_id=a1.MEMBER_ID left outer join hsp_object al1 on a1.alias_id=al1.object_id
inner join hsp_object o2 on o1.object_id=o2.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=50030) a2 on o2.object_id=a2.MEMBER_ID left outer join hsp_object al2 on a2.alias_id=al2.object_id
inner join hsp_object o3 on o2.object_id=o3.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=14) a3 on o3.object_id=a3.MEMBER_ID left outer join hsp_object al3 on a3.alias_id=al3.object_id
left outer join (select * from hsp_alias where aliastbl_id=50030) ar3 on o3.object_id=ar3.MEMBER_ID left outer join hsp_object alar3 on ar3.alias_id=alar3.object_id
inner join hsp_object o4 on o3.object_id=o4.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=14) a4 on o4.object_id=a4.MEMBER_ID left outer join hsp_object al4 on a4.alias_id=al4.object_id
left outer join (select * from hsp_alias where aliastbl_id=50030) ar4 on o4.object_id=ar4.MEMBER_ID left outer join hsp_object alar4 on ar4.alias_id=alar4.object_id
inner join hsp_object o5 on o4.object_id=o5.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=14) a5 on o5.object_id=a5.MEMBER_ID left outer join hsp_object al5 on a5.alias_id=al5.object_id
left outer join (select * from hsp_alias where aliastbl_id=50030) ar5 on o5.object_id=ar5.MEMBER_ID left outer join hsp_object alar5 on ar5.alias_id=alar5.object_id
inner join hsp_object o6 on o5.object_id=o6.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=14) a6 on o6.object_id=a6.MEMBER_ID left outer join hsp_object al6 on a6.alias_id=al6.object_id
left outer join (select * from hsp_alias where aliastbl_id=50030) ar6 on o6.object_id=ar6.MEMBER_ID left outer join hsp_object alar6 on ar6.alias_id=alar6.object_id
where o1.object_id =(select object_id from hsp_object where object_name='Total Expenditure') and
LENGTH(o6.object_name)=6
union all
select o1.object_name as LVL1, o1.object_name as LVL1_DESC_EN, al1.object_name as LVL1_DESC_AR,
o2.object_name as LVL2, o2.object_name as LVL2_DESC_EN, al2.object_name as LVL2_DESC_AR,
o3.object_name as LVL3, al3.object_name as LVL3_DESC_EN, alar3.object_name as LVL3_DESC_AR,
o4.object_name as LVL4, al4.object_name as LVL4_DESC_EN, alar4.object_name as LVL4_DESC_AR,
o5.object_name as LVL5, al5.object_name as LVL5_DESC_EN, alar5.object_name as LVL5_DESC_AR,
o5.object_name as LVL6, al5.object_name as LVL6_DESC_EN, alar5.object_name as LVL6_DESC_AR
from hsp_object o1
left outer join (select * from hsp_alias where aliastbl_id=50030) a1 on o1.object_id=a1.MEMBER_ID left outer join hsp_object al1 on a1.alias_id=al1.object_id
inner join hsp_object o2 on o1.object_id=o2.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=50030) a2 on o2.object_id=a2.MEMBER_ID left outer join hsp_object al2 on a2.alias_id=al2.object_id
inner join hsp_object o3 on o2.object_id=o3.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=14) a3 on o3.object_id=a3.MEMBER_ID left outer join hsp_object al3 on a3.alias_id=al3.object_id
left outer join (select * from hsp_alias where aliastbl_id=50030) ar3 on o3.object_id=ar3.MEMBER_ID left outer join hsp_object alar3 on ar3.alias_id=alar3.object_id
inner join hsp_object o4 on o3.object_id=o4.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=14) a4 on o4.object_id=a4.MEMBER_ID left outer join hsp_object al4 on a4.alias_id=al4.object_id
left outer join (select * from hsp_alias where aliastbl_id=50030) ar4 on o4.object_id=ar4.MEMBER_ID left outer join hsp_object alar4 on ar4.alias_id=alar4.object_id
inner join hsp_object o5 on o4.object_id=o5.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=14) a5 on o5.object_id=a5.MEMBER_ID left outer join hsp_object al5 on a5.alias_id=al5.object_id
left outer join (select * from hsp_alias where aliastbl_id=50030) ar5 on o5.object_id=ar5.MEMBER_ID left outer join hsp_object alar5 on ar5.alias_id=alar5.object_id
where o1.object_id =(select object_id from hsp_object where object_name='Total Expenditure') and
LENGTH(o5.object_name)=6
union all
select o1.object_name as LVL1, o1.object_name as LVL1_DESC_EN, al1.object_name as LVL1_DESC_AR,
o2.object_name as LVL2, o2.object_name as LVL2_DESC_EN, al2.object_name as LVL2_DESC_AR,
o3.object_name as LVL3, al3.object_name as LVL3_DESC_EN, alar3.object_name as LVL3_DESC_AR,
o4.object_name as LVL4, al4.object_name as LVL4_DESC_EN, alar4.object_name as LVL4_DESC_AR,
o4.object_name as LVL5, al4.object_name as LVL5_DESC_EN, alar4.object_name as LVL5_DESC_AR,
o4.object_name as LVL6, al4.object_name as LVL6_DESC_EN, alar4.object_name as LVL6_DESC_AR
from hsp_object o1
left outer join (select * from hsp_alias where aliastbl_id=50030) a1 on o1.object_id=a1.MEMBER_ID left outer join hsp_object al1 on a1.alias_id=al1.object_id
inner join hsp_object o2 on o1.object_id=o2.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=50030) a2 on o2.object_id=a2.MEMBER_ID left outer join hsp_object al2 on a2.alias_id=al2.object_id
inner join hsp_object o3 on o2.object_id=o3.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=14) a3 on o3.object_id=a3.MEMBER_ID left outer join hsp_object al3 on a3.alias_id=al3.object_id
left outer join (select * from hsp_alias where aliastbl_id=50030) ar3 on o3.object_id=ar3.MEMBER_ID left outer join hsp_object alar3 on ar3.alias_id=alar3.object_id
inner join hsp_object o4 on o3.object_id=o4.Parent_ID
left outer join (select * from hsp_alias where aliastbl_id=14) a4 on o4.object_id=a4.MEMBER_ID left outer join hsp_object al4 on a4.alias_id=al4.object_id
left outer join (select * from hsp_alias where aliastbl_id=50030) ar4 on o4.object_id=ar4.MEMBER_ID left outer join hsp_object alar4 on ar4.alias_id=alar4.object_id
where o1.object_id =(select object_id from hsp_object where object_name='Total Expenditure') and
LENGTH(o4.object_name)=6
Cheers,
Alp -
Extract parent and child data from an XML sequence?
I'm very new to XML, so please excuse me if I use incorrect terminology here. I've been given a schema definition (.xsd), and several sample xml files from which I need to extract data and insert it into relational tables. I've made some progress in that I've been able to hack enough to modify and register the schema and get the XML into the database both through the registered schema and into a separate table with an XMLType column. I've also been able to use the isSchemaValid function to validate the XML against the schema definition, and I've been able to extract some of the simple data elements via the extractValue function. My problem is with extracting some of the nested data - that is, extracting parent node elements and child node elements together where there is more than one value in the child node. BTW. I'm on Oracle 10gR2.
Following are the .xsd and and sample XML. Specifically, I need to select the NPI value from the PROVIDER node, and associate it with each of the CODE values from the SPECIALTIES node (which is part of the PROVIDER node).
Here's the .xsd (sorry, it's very long). The only modifications I've made to the schema definition are to add the xdb namespace and the "xdb:defaultTable="HMOSCHEMA" snippet:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0">
<xsd:element name="HMO" xdb:defaultTable="HMOSCHEMA">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="HMO_GENERAL_INFORMATION" />
<xsd:element ref="PROVIDERS" />
<xsd:element ref="FACILITIES" minOccurs="0"
maxOccurs="1" />
</xsd:sequence>
<xsd:attribute name="DATE" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="HMO_GENERAL_INFORMATION">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="MCO_ID_LIST" minOccurs="1" maxOccurs="1" />
<xsd:element ref="HMO_WEBSITE_ADDRESS" minOccurs="1"
maxOccurs="1" />
<xsd:element ref="HMO_SPECIAL_SERVICES" minOccurs="0"
maxOccurs="1" />
<xsd:element ref="HMO_DAILY_CONTACT_EMAIL_ADDRESS"
minOccurs="1" maxOccurs="1" />
<xsd:element ref="HMO_MONTHLY_CONTACT_EMAIL_ADDRESS"
minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="PROVIDERS">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" ref="PROVIDER" />
</xsd:sequence>
<xsd:attribute name="RECORDS" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="PROVIDER">
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="unbounded">
<xsd:element ref="NPI" minOccurs="1" maxOccurs="1" />
<xsd:element ref="FIRST_NAME" minOccurs="1"
maxOccurs="1" />
<xsd:element ref="LAST_NAME" minOccurs="1"
maxOccurs="1" />
<xsd:element ref="MIDDLE_INITIAL" minOccurs="0"
maxOccurs="1" />
<xsd:element ref="GENDER" minOccurs="1" maxOccurs="1" />
<xsd:element ref="LINE_1_ADDRESS" minOccurs="1"
maxOccurs="1" />
<xsd:element ref="LINE_2_ADDRESS" minOccurs="0"
maxOccurs="1" />
<xsd:element ref="CITY" minOccurs="1" maxOccurs="1" />
<xsd:element ref="STATE" minOccurs="1" maxOccurs="1" />
<xsd:element ref="ZIP" minOccurs="1" maxOccurs="1" />
<xsd:element ref="COUNTY" minOccurs="0" maxOccurs="1" />
<xsd:element ref="PHONE_NUMBER" minOccurs="1"
maxOccurs="1" />
<xsd:element ref="CLINIC_NAME" minOccurs="0"
maxOccurs="1" />
<xsd:element ref="CLINIC_TYPE" minOccurs="0"
maxOccurs="1" />
<xsd:element ref="CLINIC_NPI" minOccurs="0"
maxOccurs="1" />
<xsd:element ref="PROVIDER_OFFICE_HOURS_TENTHS"
minOccurs="0" maxOccurs="1" />
<xsd:element ref="MAXIMUM_PATIENTS" minOccurs="0"
maxOccurs="1" />
<xsd:element ref="ACCEPT_NEW_PATIENT" minOccurs="0"
maxOccurs="1" />
<xsd:element ref="PRIMARY_CARE_INDICATOR" minOccurs="0"
maxOccurs="1" />
<xsd:element ref="FOREIGN_LANGUAGES" minOccurs="0"
maxOccurs="1" />
<xsd:element ref="SPECIALTIES" minOccurs="1"
maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="SPECIALTIES">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="CODE"
minOccurs="1">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{3}" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="FACILITIES">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" ref="FACILITY_NUM"
minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="RECORDS" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="FOREIGN_LANGUAGES">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="CODE"
minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Z]{3}" />
<xsd:pattern value="[a-z]{3}" />
<xsd:pattern value="" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="HMO_SPECIAL_SERVICES">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="CODE"
minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{2}" />
<xsd:pattern value="" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="MCO_ID_LIST">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="MCO_ID" minOccurs="1" maxOccurs="unbounded">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{1}" />
<xsd:pattern value="[0-9]{2}" />
<xsd:pattern value="[0-9]{3}" />
<xsd:pattern value="[0-9]{4}" />
<xsd:pattern value="[0-9]{5}" />
<xsd:pattern value="[0-9]{6}" />
<xsd:pattern value="[0-9]{7}" />
<xsd:pattern value="[0-9]{8}" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="HMO_WEBSITE_ADDRESS">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1" />
<xsd:maxLength value="100" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="HMO_DAILY_CONTACT_EMAIL_ADDRESS">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1" />
<xsd:maxLength value="50" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="HMO_MONTHLY_CONTACT_EMAIL_ADDRESS">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1" />
<xsd:maxLength value="50" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NPI">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{1}" />
<xsd:pattern value="[0-9]{2}" />
<xsd:pattern value="[0-9]{3}" />
<xsd:pattern value="[0-9]{4}" />
<xsd:pattern value="[0-9]{5}" />
<xsd:pattern value="[0-9]{6}" />
<xsd:pattern value="[0-9]{7}" />
<xsd:pattern value="[0-9]{8}" />
<xsd:pattern value="[0-9]{9}" />
<xsd:pattern value="[0-9]{10}" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="FIRST_NAME">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LAST_NAME">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MIDDLE_INITIAL">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0" />
<xsd:maxLength value="1" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="GENDER">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0" />
<xsd:maxLength value="1" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LINE_1_ADDRESS">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LINE_2_ADDRESS">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CITY">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="STATE">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[a-zA-Z][a-zA-Z]" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ZIP">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{5}" />
<xsd:pattern value="[0-9]{9}" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="COUNTY">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{1}" />
<xsd:pattern value="[0-9]{2}" />
<xsd:pattern value="[0-9]{3}" />
<xsd:pattern value="" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PHONE_NUMBER">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{10}" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CLINIC_NAME">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0" />
<xsd:pattern value="" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CLINIC_TYPE">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0" />
<xsd:pattern value="" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CLINIC_NPI">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{1}" />
<xsd:pattern value="[0-9]{2}" />
<xsd:pattern value="[0-9]{3}" />
<xsd:pattern value="[0-9]{4}" />
<xsd:pattern value="[0-9]{5}" />
<xsd:pattern value="[0-9]{6}" />
<xsd:pattern value="[0-9]{7}" />
<xsd:pattern value="[0-9]{8}" />
<xsd:pattern value="[0-9]{9}" />
<xsd:pattern value="[0-9]{10}" />
<xsd:pattern value="" />
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PROVIDER_OFFICE_HOURS_TENTHS">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{1}" />
<xsd:pattern value="[0-9]{2}" />
<xsd:pattern value="" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MAXIMUM_PATIENTS">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{1}" />
<xsd:pattern value="[0-9]{2}" />
<xsd:pattern value="[0-9]{3}" />
<xsd:pattern value="[0-9]{4}" />
<xsd:pattern value="" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ACCEPT_NEW_PATIENT">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Z]{1}" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PRIMARY_CARE_INDICATOR">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Z]{1}" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="FACILITY_NUM">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{1}" />
<xsd:pattern value="[0-9]{2}" />
<xsd:pattern value="[0-9]{3}" />
<xsd:pattern value="[0-9]{4}" />
<xsd:pattern value="[0-9]{5}" />
<xsd:pattern value="[0-9]{6}" />
<xsd:pattern value="[0-9]{7}" />
<xsd:pattern value="[0-9]{8}" />
<xsd:pattern value="[0-9]{9}" />
<xsd:pattern value="[0-9]{10}" />
<xsd:pattern value="" />
<xsd:whiteSpace value="collapse" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:schema>
Here's a sample of the XML (significantly shortened, and names and IDs changed to protect the innocent). BTW, the XML validates cleanly against the schema definition:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<HMO DATE="03/26/2010">
<HMO_GENERAL_INFORMATION>
<MCO_ID_LIST>
<MCO_ID>11111111</MCO_ID>
</MCO_ID_LIST>
<HMO_WEBSITE_ADDRESS>HTTP://WWW.SOMEHMONAME.COM</HMO_WEBSITE_ADDRESS>
<HMO_SPECIAL_SERVICES>
<CODE>00</CODE>
</HMO_SPECIAL_SERVICES>
<HMO_DAILY_CONTACT_EMAIL_ADDRESS>somename@someurl</HMO_DAILY_CONTACT_EMAIL_ADDRESS>
<HMO_MONTHLY_CONTACT_EMAIL_ADDRESS>somename@someurl</HMO_MONTHLY_CONTACT_EMAIL_ADDRESS>
</HMO_GENERAL_INFORMATION>
<PROVIDERS RECORDS="1011">
<PROVIDER>
<NPI>1111111111</NPI>
<FIRST_NAME>JOHN</FIRST_NAME>
<LAST_NAME>DOE</LAST_NAME>
<MIDDLE_INITIAL>A</MIDDLE_INITIAL>
<GENDER>M</GENDER>
<LINE_1_ADDRESS>1111 Some Rd</LINE_1_ADDRESS>
<LINE_2_ADDRESS> </LINE_2_ADDRESS>
<CITY>NOWHERE</CITY>
<STATE>YN</STATE>
<ZIP>12345</ZIP>
<COUNTY>13</COUNTY>
<PHONE_NUMBER>1111111111</PHONE_NUMBER>
<CLINIC_NAME>SOME CLINIC - CORPORATE OFFICE</CLINIC_NAME>
<CLINIC_NPI/>
<ACCEPT_NEW_PATIENT>Y</ACCEPT_NEW_PATIENT>
<PRIMARY_CARE_INDICATOR>N</PRIMARY_CARE_INDICATOR>
<FOREIGN_LANGUAGES>
<CODE> </CODE>
</FOREIGN_LANGUAGES>
<SPECIALTIES>
<CODE>170</CODE>
</SPECIALTIES>
</PROVIDER>
<PROVIDER>
<NPI>2222222222</NPI>
<FIRST_NAME>JANE</FIRST_NAME>
<LAST_NAME>DOE</LAST_NAME>
<MIDDLE_INITIAL>J</MIDDLE_INITIAL>
<GENDER>F</GENDER>
<LINE_1_ADDRESS>2222 SOMEOTHER ST</LINE_1_ADDRESS>
<LINE_2_ADDRESS> </LINE_2_ADDRESS>
<CITY>MYTOWN</CITY>
<STATE>YN</STATE>
<ZIP>12345</ZIP>
<COUNTY>13</COUNTY>
<PHONE_NUMBER>2222222222</PHONE_NUMBER>
<CLINIC_NAME>SOME CLINIC - MYTOWN</CLINIC_NAME>
<CLINIC_NPI/>
<ACCEPT_NEW_PATIENT>Y</ACCEPT_NEW_PATIENT>
<PRIMARY_CARE_INDICATOR>N</PRIMARY_CARE_INDICATOR>
<FOREIGN_LANGUAGES>
<CODE> </CODE>
</FOREIGN_LANGUAGES>
<SPECIALTIES>
<CODE>322</CODE>
<CODE>329</CODE>
</SPECIALTIES>
</PROVIDER>
</PROVIDERS>
<FACILITIES RECORDS="2">
<FACILITY_NUM>1000000001</FACILITY_NUM>
<FACILITY_NUM>2000000002</FACILITY_NUM>
</FACILITIES>
</HMO>
As you can see, the SPECIALTIES node can contain more than one CODE value, si I can't use extractValue to retrieve them. Again, I need to extract the NPI value from the PROVIIDER node, and associate it with each of the CODE values from the SPECIALTIES node. So, what I would need to extract from this sample XML would be:
NPI CODE
1111111111 170
2222222222 322
2222222222 329
This seems like it should be a pretty routine requirement, but I've tried everything I can think of (that is, everything I've learned to this point), and have not yet found a way............
Ideally, the solution to extracting this data would utilize SQL (not PL/SQL, or Java, or XSL, etc) with XML extraction functions (e.g. extract, extractValue, XMLSequence, XMLTable, etc).
Can anyone provide me with an example of how that iterative specialy code data could be extracted? Do I need to modify the .xsd to facilitate this extraction (so that registration of the schema results in other objects in the database)?
Any suggestions or examples would be greatly appreciated.
Thanks in advance, Dan
P.S. - I hope the XML displays OK when I post this question!Hi,
Thanks for your detailed sample, it's very helpful.
This seems like it should be a pretty routine requirementIndeed, that's a classic (once you've got the method).
So, here's how you can do it :
SELECT x1.npi, x2.code
FROM t,
XMLTable(
'/HMO/PROVIDERS/PROVIDER'
passing t.doc
columns
npi number path 'NPI',
specialties xmltype path 'SPECIALTIES'
) x1,
XMLTable(
'SPECIALTIES/CODE'
passing x1.specialties
columns
code number path '.'
) x2
;Assuming the XML is stored in column T.DOC.
As you see, for each NPI, the trick is to pass the entire SPECIALTIES node (kind of a join) to another nested XMLTable so that each CODE could be extracted as well.
There's another method using only one XMLTable and a little more complex XQuery. I'll try to post it soon.
HTH.
Edit : 2nd method
SELECT x.*
FROM t,
XMLTable(
'for $i in /HMO/PROVIDERS/PROVIDER/SPECIALTIES/CODE
return element e
attribute npi { $i/../../NPI },
$i/text()
passing t.doc
columns
npi number path '@npi',
code number path '.'
) x
;Edited by: odie_63 on 27 mai 2010 18:43 -
Incorrect totals from cache with CustomRollupColumn and non-parent-child dimensions
Hello. Before I start let me apologise for my English :)
We have a very complex cube, with 2 (actually more, but only these 2 are important) parent-child dimensions.
One of them has CustomRollupColumn defined.
Not long ago we have decided to make refactoring of our cube. This also included making these dimensions non-parent-child.
All our old reports started to work much faster after that... but we have mentioned that sometimes they show incorrect totals, or no totals at all.
We spend a lot of time trying to figure out what's wrong and finally we had found that if we clear cache before next refresh of the report - the totals are always correct!
If we don't clear cache - we get wrong totals second time, and each next time after that. If we see wrong totals - we could clear cache and get correct totals once again.
If we use "Real Time Olap=True;" connection string parameter - the totals are always correct because cache is not used.
But we don't like this workaround.
Is there any fix for this bug? Google shows that this problem exists from SQL2005, and still we have it :( Also, there is adivice to set CalculationCoverPolicy to 9 - we have tried - but it was fruitless.
And if we revert these 2 dimensions back to parent-child - all working fine again, but as slow as it was before the refactoring :(Hi Bateks,
Glad to hear that your issue had been solved by yourself, thank you for you sharing which will help other forum members who have the similar issue.
Regards,
Charlie Liao
TechNet Community Support -
I'm creating a SSRS report using SSAS cube as a source.
When creating a dataset for the report, I'm having trouble with MDX to select a specific dimension member and its descendants from parent child dimension where dimension member names can be same in dimension hierarchy.
Lets say for example that I have an account dimension where,
In level 02 I have company ID:s 101, 102, 103 and so on...
In level 03 I have Balance sheet
In level 04 I have some account groups, Assets, Liabilities and so on... and In level 05 I have individual accounts
How can I select for example company 102:s Assets from level 04 and its descendants?
Normally in adventure works I would do this if I've wanted Current Assets and its descendants:
SELECT NON EMPTY { [Measures].[Amount] } ON COLUMNS, NON EMPTY
{ (DESCENDANTS([Account].[Accounts].[Account Level 03].[Current Assets]) ) } ON ROWS
FROM [Adventure Works]
But in my Account dimension at level 04 I have Assets member as many times as I have companies in level 02.
TuomoHi Tuomo Helminen,
To this requirement of yours, I would recommend you use Cascading Parameters in Reporting services, you can refer to this FAQ How do I create cascading parameters when using cube database in Reporting Services at this link
http://blogs.msdn.com/b/sqlforum/archive/2011/04/11/forum-faq-how-do-i-create-cascading-parameters-when-using-cube-database-in-reporting-services.aspx
Thanks,
Challen Fu
TechNet
Subscriber Supportinforum
If you have any feedback on our support, please [email protected]
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Load Parent-Child dimension with attributes by rule file
Well, I've cracked my head open while banging against this wall.
Task is plain & simple:
How can I load build dimension from such table, using rule file?
Data
ProductParent ProductChild ProductAttribute
Balls Ball_8 Round
I want to load both product dimension and attribute by single rule file (neither of these dimensions exists in database before load), so I do the following:
1) Set dimension build settings, creating dimension Products (marking it P\C generated, sparse), having an attribute dimension AttributeDim
2) Mark the fields as Parent, Child and AttributeDim of dimension Products
After loading rule file a get three types of errors:
a) "Base member (Balls) association level does not match base dimension association level" -- does this mean that I cannot assign attributes in P\C way?
b) "Record #327 - Can not uniquely identify member by Balls (3335)
Balls Ball_8 Round" -- That's strange, I thought member should be identified by Ball_8 (and this column is unique)
c) "\\Record #418 - Error in association transaction [Ball_8] to [Round] (3362)"
I've read all I could find on topic from this forum, network45 board and going to start my way through metalink3, but maybe some kind soul will rescue me from drowning in information ocean?Hi,
Outline is blank at the start of load and I expect dimensions Product and ProdAttribute to be added.
Generations are unapplicable, since I can't turn this parent-child dimension (it's ragged) into generation one.
And, by the way Integration Services manages to do this somehow, why rule files wouldn't? -
Parent Child Dimension Not displaying Name value.
I have a parent Child attribute in my dimension. It show the correct ID value in the reports but when I change the value from the NameColumn to be something else it still only shows the ID value.
I have an identical case in another dimension and it is working correctly. However this dimension for some reason does not seem to work and I believe they are built the same way I must be missing something. I have tried to show the OrgNodeID
and tried to display the OrgNodename but neither displays all it displays is the intdimParentOrgNodeID.
My dimension table looks something like this
intdimOrgNodeID int Key (surreget key)
intOrgNodeID int (Actual ID)
intDimParentOrgNodeID
intOrgNodeName
In the Propertys I have set
KeyColumns = tbldimOrgNode.intDimParentOrgNodeID
NameColumn = tbldimOrgNode.intOrgNodeID
Parent-child values
=NonLeafDataVisible
=*(Direct)
=
=ParentIsBlankSelfOrMissing
=(none)
Ken CraigI have been pulling my hair out for days to find this and what I finally found that resolved this shocked me and I am still not sure why it would matter. You can see below my table and then dimension info. Although I agree my OrgNode ID attribute
is really not needed in AS and could be removed. In places where that is used we could instead rename the key column Dim OrgNode ID to OrgNode ID. However why the key attribute must have the name column set to intOrgNodeID
instead of just using the Key value of intdimOrgNodeID is what I am lost at.
Outside of this parent dimension I have never seen issues with this. I want to say sometimes in the past I have seen duplicates if I use the surreget key to display the actual ID so I have normally left that as a key and just added another attribute
to house the actual ID, like I did below.
Can someone explain to me this and what is the best suggested practice here.
My table is like this
intdimOrgNodeID int Key (surreget key)
intOrgNodeID int (Actual ID from source and used by customers)
intDimParentOrgNodeID (ID used for parent child (it is the Parent intOrgNodeID surreget
key intdimOrgNodeID))
intOrgNodeName (Source Name)
My AS dimension is like below
Dim OrgNode ID
AttributeHierarchyVisible=False
KeyColumns = tbldimOrgNode.intDimOrgNodeID (Integer)
NameColumns= tbldimOrgNode.intDimOrgNodeID (Integer)
OrgNode ID
AttributeHierarchyVisible=True
KeyColumns = tbldimOrgNode.intOrgNodeID (Integer)
NameColumns= tbldimOrgNode.intOrgNodeID (Integer)
OrgNode Hierarchy ID
Usage=Parent
AttributeHierarchyVisible=True
KeyColumns = tbldimOrgNode.intDimParentOrgNodeID
NameColumns= tbldimOrgNode.intOrgNodeID (WChar)
Change I had to make was this
Dim OrgNode ID
From NameColumns= tbldimOrgNode.intDimOrgNodeID (Integer)
to
NameColumns= tbldimOrgNode.intOrgNodeID (Integer)
Ken Craig -
Security on Employee Parent Child Dimension with SCD 2
Hi
I am looking for a solution for how to get all child members of a Parent employee including the one in the history. I tried multiple ways the problem which I am facing are
Scenario 1: When I am using this approach, since the Employee with 'Jump' as employee id do have a history record with no children under him I am getting 'Null'. But there are new records (last 3 SCD changes) where he has employees under him.
SELECT descendants(
// Check if current employee is a manager
iif(hierarchize(exists([Employee].[Manager Employee Dim ID].members,
(strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))),post).item(0).item(0).parent.datamember is
hierarchize(exists([Employee].[Manager Employee Dim ID].members,
(strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))), post).item(0).item(0),
// End of check if current employee is manager
hierarchize(exists([Employee].[Manager Employee Dim ID].members,
(strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))),post).item(0).item(0).parent,
hierarchize(exists([Employee].[Manager Employee Dim ID].members,
(strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))), post).item(0).item(0))) ON 0,
[Measures].[Aggregate Count] On 1
FROM [Data Ware House]
Scenario 2: When I put a filter (as a set) to check if the record is current then I am getting the latest record for employee 'Jump'. But here the problem is that the employee under him I am only getting the [Measures].[Aggregate Count] of the latest
change only.
SELECT descendants(
// Check if current employee is a manager
iif(hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
(strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])),
post).item(0).item(0).parent.datamember is
hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
(strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])), post).item(0).item(0),
// End of check if current employee is manager
hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
(strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])),
post).item(0).item(0).parent,
hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
(strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])), post).item(0).item(0))
) ON 0,
[Measures].[Contract Change Aggregate Count] ON 1
FROM [Data Ware House]
If any one can help me out with this that will be helpful.
What I need is all the members under the employee 'Jump', including the Old scd records for 'jump'
regards
Robin
RobsHi,
Outline is blank at the start of load and I expect dimensions Product and ProdAttribute to be added.
Generations are unapplicable, since I can't turn this parent-child dimension (it's ragged) into generation one.
And, by the way Integration Services manages to do this somehow, why rule files wouldn't? -
Do the custom rollup member formulas work recursively for parent child dimension?
Hi
We have custom rollup set up for Account dimension which is parent child.
It seems to work fine when the custom member formula refers to a base account member i.e. if the formula for MemberKey4 is (MemberKey1 + MemberKey2) then it shows the sum of the underlying members 1 and 2.
But if the formula for MemberKey10 is (MemberKey3 + MemberKey4) then it should evaluate the value for MemberKey4 first and then add to it value for MemberKey3 to come up with final number for MemberKey10.
Do the custom rollup work fine with the recursive calculations? Is this recursion limited to some level?
Thanks
ShaileshHi Jorg,
Thanks for your input.
Actually the hierarhcy is more determined by the parent child relationship. So we cannot move the members as per the formula. And further the formulas are not always additive, there are divisions and multiplactions happening also.
Further the calculated members (account members) are used in different places, the usage level of calculated members could be 3 in some cases i.e. MemberKey15 = (calculated using MemberKey10 = (calculated using MemberKey7 = (Calculated using MemberKey4 = (calculated using base members)))). Now inserting the base members in place of a calcuated member becomes more of string manipulation.
And on the top of above complexity, the formulas are not static and they are more user defined, they may change between time periods, which forces us to write a dynamic procedure to translate the 'business formula' into SSAS formula. We expect the custom rollup to work as expected (i.e. if the formula contains a calculation involving the calculated member, it should resolve that first and so on) and we have written generic procedure to replace the Account Code in the 'business formula' with the accont key value with the account hierarchy char string.
In the link http://doc.ddart.net/mssql/sql2000/html/olapdmad/agmdxadvanced_6jn7.htm for AS2000, it talks about the calculation pass deapth, it says:
.......If a cube has custom rollup formulas or custom rollup operators, a second calculation pass is performed to handle the computations needed to calculate these features.......
Now from the above, it is obvious that the OLAP engine will automatically go into recursion if the formula contains a cacluated member and it knows that the calculated member has to be resolved first before calculating the final formula result. The above article also talks about 'Calculation Pass Number' property in the AdvanceCube Editor (AS2000), which can be set to the value depending on the expected number of passes required in a given scenario. I don't find such an equivalent peoperty for SSAS 2005.
Would anybody please throw some more ideas / insights on this issue?
Jorg, thanks again for your input...
Shailesh -
Inclue children and exclue children in a single hierarchy in parent child dimension in mdx
hi,
include children and exclude children in a single hierarchy in parent child dimension in mdx
*12-parent
**20-parent
- 9-parent
--250-child1
--210-child2
--240-child3
aggregation of 12-parent only
aggregation of 20-parent only
aggregation of 9 with children
regards,
ManishHi manishcal16PPS,
According to your description, you have a parent child dimension in your cube. Now you want to use one measure use show aggregation value including/excluding child member based on different parent level member. Right?
In this scenario, we could use IIF() in the calculated measure to apply different calculation depends on the current dimension member. Please refer to query below:
with member [x] as
IIF([Dim].[Hierarchy].CurrentMember is [Dim].[Hierarchy].[Parent].&[9]
sum(Descendants([Dim].[Hierarchy].CurrentMember,
[Date].[Calendar].[Parent]),
[Measures].[Amount])
sum([Dim].[Hierarchy].CurrentMember,[Measures].[Amount])
select [x] on 0,
[Date].[Calendar].[Parent].members on 1
from
[Cube]
Best Regards,
Simon Hou
TechNet Community Support -
Dimension tables - parent child or hierarchical
The data I m dealing with is structured as follow.
A customer has many stores and each store has a POSSystem.
Customer
Stores
POSSystem
So now when I create Dimensions, will I create as:
TableName Cols
DimCustomer CustKey
DimStores StoreKey, CustKey
DimPOS POSKey, StoreKey, CustKey
Are these Hierarchical or Parent Child?
Now when I will create Fact table, will I have:
TableName Cols
Sample1: DimFactPOS CustKey,POSKey,StoreKey, #trans
OR
Sample2: DimFactPOS POSKey, #trans
If I do sample1, then why do I keep "StoreKey, CustKey" in DimPOS?From your question, I can assume that you have beginners knowledge in Data modeling and Data Warehousing.
Let me elaborate it and dilute your confusion.
You have designed
Star Schema; basic intention for having star schema is to have normalized fact tables and de-normalized dimension tables.
Reason you are creating three dimension (i.e. DimCustomer, DimStores and DimPOS) here because you must have many-to-one referential integrity between each level. You can google about Hierarchies,
Levels and Level relationships to get insight information about it.
Keeping normalize data in dimensions and keeping keys in fact table is a business decision. To which level you want to show the aggregated data? You
need to define granuality level based on business needs.
As in star schema, there is 1 fact table related to different dimensions. If I sub divide your assumption, Sample 1 represents
Data Mart and Sample 2 represents Data Warehouse.
I hope it will help you in understanding basic concepts. -
Filtering Parent-Child Hierarchy in SSAS Dimension
Hello,
I have a parent child hierarchy in ssas dimension. Parents level can be vary. As an example, I have 4 levels and parent may exist in level 1, level 2 or level 3.
What I need to do is filter those parents using one of the attributes in that dimension. I can't do it as normal, because once I apply a filter to parents, that will be affected to its children as well.
what normally happens
Parent1(attribute=true) - > Child 1(attribute=true) -> Child 2 (attribute=true)
Parent 2(attribute=true) -> Child 3 (attribute=true)
what I need
Parent1(attribute=true) - > Child 1 -> Child 2
Parent 2(attribute=true) -> Child 3
How can I achieve this?Finally descendant function worked for me. I had to filter necessary properties first.
WITH SET ParentCodes AS (
Descendants(
FILTER(
[DimX].[Code].members,
[DimX].[Code Parent].currentmember.Properties("Area")
= "Northern"),,
SELF)
SELECT
{[Measures].[TotalAmount]} ON 0,
{ParentCodes } ON 1
FROM [Cube]
Hope this helps
Maybe you are looking for
-
Photo files - where are they?
I'm a new mac user, and trying to point my cloud service (Wuala) at the folder holding my photos (to backup and have access to on other computers), but it seems that I can only direct it to iPhoto, which uploads a whole host of files, none of which l
-
... so I downgraded back to 2.6.33.4-1 along with the headers, got rid of linux-firmware and reinstalled kernel26-firmware. But it still isn't working. iwconfig spurts out all the expected info and the card (Intel Corporation PRO/Wireless 2200BG [Cal
-
New phone won't connect to home network, works fine on other networks.
I have a new 5s and it will not connect to my home wireless network. It connects fine to other networks. I have tried resetting network connections, resetting the router and all other things I can think of. My wife also has a 5s that connects fine an
-
How can I end a free trial? I can't afford to pay for the full software.
-
Mi hanno venduto un iphone con icloud e non so la password da inserire come devo fare?
mi hanno venduto un iphone con icloud e non so la password da inserire come devo fare?