suppachartt Posted August 3, 2009 Share Posted August 3, 2009 Hi all,I have data in PRODUCT_DIMVIEW table that look like this,PRODUCT PRODUCT_LEVEL PRODUCT_LV1_DESC PRODUCT_LV2_DESCPT 1 Total Products (null)P01 2 Total Products Product 1P02 2 Total Products Product 2Here is my dimension schema,<Dimension type="StandardDimension" foreignKey="PRODUCT" name="Product"> <Hierarchy hasAll="true" primaryKey="PRODUCT"> <Table name="PRODUCT_DIMVIEW" schema="ESADMIN"></Table> <Level name="lv1" column="PRODUCT" type="String" uniqueMembers="true"></Level> <Level name="lv2" column="PRODUCT" type="String" uniqueMembers="false"></Level> </Hierarchy></Dimension>How can I tell mondrian that in lv1 Level, I want just only product_id = PT to show up and lv2 Level has only 'P01' and 'P02' data? I can write SQL to select data by level. How can I do this in this schema file?Cheers,SuppachartPost Edited by suppachartt at 08/03/2009 08:21 Link to comment Share on other sites More sharing options...
swood Posted August 4, 2009 Share Posted August 4, 2009 So you have all the data pre-aggregated to all the levels of detail that you want. This is not what the OLAP engine expects. I would ignore the total rows altogether, and have a hierarchy like: <Hierarchy hasAll="true" primaryKey="PRODUCT"> <Table name="PRODUCT_DIMVIEW" schema="ESADMIN"></Table> <Level name="Product" column="PRODUCT" type="String" uniqueMembers="true"></Level> </Hierarchy> How does the dimension join to the facts? I can't imagine the total rows in the dimension having a foreign key to the facts. ShermanJaspersoft Link to comment Share on other sites More sharing options...
suppachartt Posted August 5, 2009 Author Share Posted August 5, 2009 Hi Sherman, Thank you for your reply, Sherman. Yes, our data is pre-aggregated straight out of Oracle OLAP engine. In the fact table has the summary top level for each dimension along with all the child level data, we have several dimensions. The fact table size is massive. In the fact table has PRODUCT column which contains product_id. We use this column to join with dimension PRODUCT_DIMVIEW table using PRODUCT as a key. The problem is when I used the schema like the one you suggested, the mondrian will roll-up all the data from P01 to P86 including PT in the fact table which is not right as PT is the summarize level of P01 to P86, in other word, the figure I end-up with is double counting. Cheers,SuppachartPost Edited by suppachartt at 08/05/2009 00:41 Link to comment Share on other sites More sharing options...
swood Posted August 6, 2009 Share Posted August 6, 2009 Do you actually have facts with PRODUCT = "PT"? If so, I can see you would have a problem with double counting. You could use a <View> on the dimension instead, which will be SQL to exclude all the summary only rows. ShermanJaspersoft Link to comment Share on other sites More sharing options...
suppachartt Posted August 7, 2009 Author Share Posted August 7, 2009 Thank you, will try that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now