Current Position:Home > Multiple fact tables, aggregation and model problems

Multiple fact tables, aggregation and model problems

Update:10-11Source: network consolidation
Advertisement
Hi,
I am developing a OLAP Application with 2 dimensions (product,location) and a few measures (sales_qty, sales_value, sale_price, cost_price, promotion_price, average_market_price, etc). I also have a BiBean Crosstab to explore the data.
I'm having the following problems:
- The measures are in different fact tables.
When using cwm2_olap_table_map.Map_FactTbl_Measure, I can only map the measures from the first fact table, the others return "Exact fetch returns more than the request number of rows".
- The 'price_' measures shouldn't aggregate to higher levels of the dimension hierarchies. I have changed the default aggregation plan, but in the crosstab data is still shown in the higher levels. Is there any way to show N/A in levels that I don't want to aggregate?
- How can I add a calculated field that is the result of a complex set of business rules (with IF/THEN/ELSE statements and calls to existing oracle functions) and precalculate it during batch?
Thanks,
Ricardo

The Best Answer

Advertisement
Keith, thanks for the quick answer!
Some questions regarding your comments:
1) The measures are in different fact tables
- My application will show all the measures in the same report. My question is, will performance be affected by creating separate cubes or creating one cube? I believe that if I don't use an AW, it shouldn't, but I will have an AW. Performance is the main reason why I'm using Oracle OLAP. I need fast access to measures in different fact tables in one report. Those measures will be used in complex calculated fields, and probably in 'what if' analysis.
2) When using cwm2_olap_table_map.Map_FactTbl_Measure, I can only map the measures from the first fact table, the others return "Exact fetch returns more than the request number of rows".
Here is the complete script I am using to create the cube:
execute cwm2_olap_cube.Create_Cube('OLAP','CUBE_REL_3','CUBE_REL_3','MY_CUBE','MY_CUBE');
execute cwm2_olap_cube.add_dimension_to_cube('OLAP', 'CUBE_REL_3','OLAP', 'DIM_STORE');
execute cwm2_olap_cube.add_dimension_to_cube('OLAP', 'CUBE_REL_3','OLAP', 'DIM_ITEM');
-- MEASURES - FACT TABLE 1 (F_SALES)
execute cwm2_olap_measure.create_measure('OLAP', 'CUBE_REL_3','SALES_MARGIN', 'Sales Margin','Sales Margin', 'Sales Margin');
execute cwm2_olap_measure.create_measure('OLAP', 'CUBE_REL_3','SALES_QTY','Sales Quantity','Sales Quantity','Sales Quantity');
execute cwm2_olap_measure.create_measure('OLAP', 'CUBE_REL_3','SALES_VALUE', 'Sales Value','Sales Value', 'Sales Value');
-- MEASURES - FACT TABLE 2 (F_PVP_MIN_MAX)
execute cwm2_olap_measure.create_measure('OLAP', 'CUBE_REL_3','PVP_MIN','pvp min','pvp min','pvp min');
execute cwm2_olap_measure.create_measure('OLAP', 'CUBE_REL_3','PVP_MAX', 'pvp max','pvp max', 'pvp max');
-- FACT TABLE 1 MAPPINGS
execute cwm2_olap_table_map.Map_FactTbl_LevelKey('OLAP','CUBE_REL_3','OLAP','f_sales','LOWESTLEVEL','DIM:OLAP.DIM_STORE/HIER:STORE/LVL:L0/COL:COD_STORE;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER1/LVL:L0/COL:COD_ITEM;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER2/LVL:L0/COL:COD_ITEM;');
execute cwm2_olap_table_map.Map_FactTbl_Measure('OLAP', 'CUBE_REL_3','SALES_MARGIN','OLAP','f_sales','SALES_MARGIN', 'DIM:OLAP.DIM_STORE/HIER:STORE/LVL:L0/COL:COD_STORE;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER1/LVL:L0/COL:COD_ITEM;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER2/LVL:L0/COL:COD_ITEM;');
execute cwm2_olap_table_map.Map_FactTbl_Measure('OLAP', 'CUBE_REL_3','SALES_QTY', 'OLAP', 'f_sales', 'SALES_QTY','DIM:OLAP.DIM_STORE/HIER:STORE/LVL:L0/COL:COD_STORE;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER1/LVL:L0/COL:COD_ITEM;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER2/LVL:L0/COL:COD_ITEM;');
execute cwm2_olap_table_map.Map_FactTbl_Measure('OLAP', 'CUBE_REL_3','SALES_VALUE', 'OLAP', 'f_sales', 'SALES_VALUE','DIM:OLAP.DIM_STORE/HIER:STORE/LVL:L0/COL:COD_STORE;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER1/LVL:L0/COL:COD_ITEM;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER2/LVL:L0/COL:COD_ITEM;');
-- FACT TABLE 2 MAPPINGS
execute cwm2_olap_table_map.Map_FactTbl_LevelKey('OLAP','CUBE_REL_3','OLAP','f_pvp_min_max','LOWESTLEVEL','DIM:OLAP.DIM_STORE/HIER:STORE_HIER1/LVL:L1/COL:COD_STORE;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER1/LVL:L4/COL:COD_ITEM;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER2/LVL:L4/COL:COD_ITEM;');
execute cwm2_olap_table_map.Map_FactTbl_Measure('OLAP', 'CUBE_REL_3','PVP_MIN','OLAP','f_pvp_min_max','PVP_MIN', 'DIM:OLAP.DIM_STORE/HIER:STORE_HIER1/LVL:L1/COL:COD_STORE;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER1/LVL:L4/COL:COD_ITEM;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER2/LVL:L4/COL:COD_ITEM;');
execute cwm2_olap_table_map.Map_FactTbl_Measure('OLAP', 'CUBE_REL_3','PVP_MAX', 'OLAP', 'f_pvp_min_max', 'PVP_MAX','DIM:OLAP.DIM_STORE/HIER:STORE_HIER1/LVL:L1/COL:COD_STORE;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER1/LVL:L4/COL:COD_ITEM;DIM:OLAP.DIM_ITEM/HIER:ITEM_HIER2/LVL:L4/COL:COD_ITEM;');
-- CUBE VALIDATE
execute CWM2_OLAP_VALIDATE.Validate_Cube('OLAP','CUBE_REL_3');
The error is in the cwm2_olap_table_map.Map_FactTbl_Measure command for the first measure of the second fact table. Am I doing something wrong?
Regarding issues 3) and 4), I will follow your sugestions. I'll get back to you on this later.
Once again, thanks for the help, it is being most helpful.
Ricardo Sá
  • Multiple fact tables, aggregation and model problems Update:10-11

    Hi, I am developing a OLAP Application with 2 dimensions (product,location) and a few measures (sales_qty, sales_value, sale_price, cost_price, promotion_price, average_market_price, etc). I also have a BiBean Crosstab to explore the data. I'm having

  • Sql Problems, Same Field Names In Multiple Mysql Tables? Update:10-11

    I have a keyword search that searches multiple DB tables for thumbnail images using UNION ALL. I have two pages, results.php, and view.php.  My goal is to able to click a thumbnail image on results.php and be directed to a larger version of that same

  • Multiple DEVL_PROJECT_ID for the same model in CZ_DEVL_PROJECTS Table. Update:10-11

    Hi, Did anyone came across this issue!! I am triggering the config engine from back and and trying to pick up a model but it has multiple devl_project_id's. :( I could see multiple DEVL_PROJECT_ID for the same model in CZ_DEVL_PROJECTS Table. Apart f

  • Multiple Main Table Question Update:10-11

    I am new to MDM 7.1 & Multiple Main Tables. I have a very basic questionu2019 My Requirement is that I have to keep Two Main Tables, 1.      Manufacturer Parts Master Table and the key is Manufacturer Name + Manufacturer Part No (Two fields) 2.     

  • Collect data from a dynamic XML file into multiple internal tables Update:10-11

    I need to convert the XML file into multiple internal tables. I tried many links and posts in SDN but still was facing difficulty in achieving this. Can some one tell me where I am going wrong. My XML file is of the following type.It is very complex

  • Join multiple fact tables and dimensions and use all tables in report issue Update:10-11

    Hi, I have a report requirements and need to use multiple fact tables and unconformed dimensions as described below Fact table: F1,F2,F3 Dimensions tables: D1.....D9 F1:(joined to) D1,D2,D3,D4 F2::(joined to)D1,D2,D5,D6 F3::(joined to)D1,D2,D7,D8 D7:

  • From IDOC to Multiple Oracle tables Structure Update:10-11

    Hi Guys, I am doing a one Senario which is Custom idoc and Custom Tables of oracle they both have same fields and Same Sturucte does it possible from to do 1:1 mapping shall i process these in 1:n.Need a sugestion in these  How i can slove these prob