tag:blogger.com,1999:blog-38200314715245037312024-02-24T23:29:38.383-08:00Oracle OLAPThe most powerful, open Analytic EngineBrian Macdonaldhttp://www.blogger.com/profile/18408740222558531436noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-3820031471524503731.post-16956280155715827052008-12-16T09:30:00.000-08:002008-12-16T09:35:43.018-08:00New 11g OLAP Cube Materialized Views tutorial posted onto OTNAnother new tutorial has been added to the <a href="http://www.oracle.com/technology/products/bi/olap/index.html">Oracle OLAP home page on OTN</a>.<br /><br />This tutorial is titled '<a href="http://www.oracle.com/technology/products/bi/olap/collateral/OLAP_11g_MV_query_rewrite.html">Oracle OLAP 11g: Setting Up Cube Materialized Views for Query Rewrite</a>'<br /><br />The tutorial describes how to enable cubes as Cube Materialized Views, and how to enable and troubleshoot Query Rewrite using Analytic Workspace Manager 11.1.0.7. It is intended as a quickstart for intermediate developers.Stuart Bunbyhttp://www.blogger.com/profile/10781347144821555643noreply@blogger.com0tag:blogger.com,1999:blog-3820031471524503731.post-62501789249891909372008-11-25T01:07:00.000-08:002008-11-25T14:03:25.817-08:00New 11g OLAP tutorial posted onto OTNA new tutorial has been added to OTN.<br /><br />The tutorial is aimed at newcomers to Oracle OLAP and is <a href="http://www.oracle.com/technology/products/bi/olap/collateral/create_11g_olap_cube.html">a guide to creating and populating an 11g OLAP cube.</a><br /><br />This is perfect for people who are looking for a gentle introduction to using the Analytic Workspace Manager OLAP administration tool and understand the basic steps in building an 11g OLAP cube.Stuart Bunbyhttp://www.blogger.com/profile/10781347144821555643noreply@blogger.com0tag:blogger.com,1999:blog-3820031471524503731.post-29183148074305080842008-03-27T07:30:00.000-07:002008-12-11T15:25:29.775-08:00Creating A Calculated Measure Cube - IOGALFF<p style="font-style: italic;" class="MsoNormal"><span lang="EN-GB">(Firstly, this is information relates only to OLAP 10gR2.<span style=""> </span>There are a number of changes within OLAP11gR1 and the following scenario has not been tested with 11g)</span></p> When you venture into most supermarkets today, somewhere on one of the many isles there will be a BOGOF – buy one get one free. Well how about an OLAP offer: “IOGALFF” – install one get at least fourteen free. I admit it is not quite as catchy as the original, but the benefits are huge and it has the result of making life so much easier.<br /><br />One of the more interesting challenges of using Analytic Workspace Manager (and also OWB) relates to managing all the calculated measures within a cube. Every measure should really be accompanied by a standard set of calculated measures such as:<br /><br /><ul><li>Current Period</li><li>Last Year</li><li>Last Year %</li><li>Prior Period</li><li>Prior Period %</li><li>Year to Date</li><li>Year to Date Last Year</li><li>Year to Date Last Year %</li><li>Quarter to Date</li><li>Quarter to Date Last Year</li><li>Quarter to Date Last Year %</li><li>3-Month Moving Average</li><li>6-Month Moving Average</li><li>12-Month Moving Average</li><li>Dimension “A” Share of All Members</li><li>Dimension “A” Share of Parent</li></ul><br /><br />Its is the addition of these types of measures that adds real value to the your BI application. As I have stated many times before: business users are not interested in looking at data from base measures, typically they are more interested in trends based on the prior period or prior year, share of revenue, moving averages and so on. This adds a lot of work for the cube designer as they need to add at least 14 calculated measures for each base measure as well as two additional calculated share measures for each dimension associated with each cube.<br /><br />Which adds up to a lot of measures and manually creating all these measure is likely to take a considerable amount of time. If we take the command schema sample that is shipped with BI10g, this contains 5 base measures (costs, quantity, revenue, margin, price) with 4 dimensions (channel, geography, product, time), which translates to<br /><br /><span style="font-weight: bold;font-size:85%;" ><span style="font-family:courier new;"> 5 * 14 calculated measures</span><br /><span style="font-family:courier new;"> + </span><br /><span style="font-family:courier new;"> 5 * 3 (dimensions - channel, geography, product) * 2 calculated share measures</span><br /><br /><span style="font-family:courier new;"> = 100 calculated measures.</span><br /><br /></span>As I said, it is very easy to generate a lot of calculated measures.<br /><br /><br />So is there a more intelligent way of managing calculated measures? What is the quickest way to add all these additional calculations to a cube? One way is to use the Excel Accelerator to add the calculated measures to your AW. It is relatively easy to use and allows you to use normal Excel tools such as cut & paste to quickly create all the calculations you could ever need. You can download the Excel Accelerator from the OLAP OTN Home Page, or by clicking <a href="http://www.oracle.com/technology/products/bi/olap/index.html">here</a>. Look for these links:<br /><br /><a href="http://download.oracle.com/otn/java/olap/SpreadsheetCalcs_10203.zip">Creating OLAP Calculations using Excel</a><br /><a href="http://www.oracle.com/technology/products/bi/olap/OLAP_SpreadsheetCalcs.html">Creating OLAP Calculations using Exce Readme</a><br /><br />During a recent POC, we used a more interesting approach that takes the use of customer calculations to a new level. In many ways this goes back to the various techniques we used when creating Express databases for use with Sales Analyzer to make life easier for both administrators and users. The approach is quite simple – use and additional dimension to define the type of calculation you want to execute and link this to a DML program to return the required results. The list of calculated measures listed above are converted into dimension members, which provides another way to slice, dice and pivot the data. As you can see here, the dimension member that identifies the type of calculation is in the row edge with the measure in the column edge. In this way, only one calculation is required which is used across all the available measures.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2XQH0z5nEcFGNUZDSOOnMtoIvg0HxhYkDL9M7dtxvbw1-nqviIov5cQuzGT9LQ-f6HB2bzgriQ1DmiiAUByD1DspH1YA8ZeR6aK9mWzfGSyZWt58GlL4gipD3Yt9UlhUZdBRLZ1vEhV8/s1600-h/moz-screenshot-17.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2XQH0z5nEcFGNUZDSOOnMtoIvg0HxhYkDL9M7dtxvbw1-nqviIov5cQuzGT9LQ-f6HB2bzgriQ1DmiiAUByD1DspH1YA8ZeR6aK9mWzfGSyZWt58GlL4gipD3Yt9UlhUZdBRLZ1vEhV8/s400/moz-screenshot-17.jpg" alt="" id="BLOGGER_PHOTO_ID_5182076332047329618" border="0" /></a><br /><br />What this means is: by installing one simple (well, everything is relative) calculated measure you can get upto fourteen additional calculations for free. Hence the acronym “IOGALFF” – install one get at least fourteen free.<br /><br />How is all this managed? There are five basic steps to creating this type of reporting solution:<br /><ol><li>Create a new dimension to control the types of calculations returned</li><li>Add some additional attributes to the time dimension to help manage some of the time series arguments for specific calculations</li><li>Create an OLAP DML program to return the data</li><li>Create a new cube that includes the new calculation type dimension and add a calculated measure that calls the OLAP DML program to return the required data<br /></li><li>Create a SQL View over the cube</li></ol><br /><span style="font-weight: bold;">Step 1 – Creating the new Time View dimension</span><br /><br />I have called the dimension containing the list of calculated members, Time View (mainly because the majority of the calculations are time based but may be a better name would be "<span style="font-style: italic;">measure view</span>" ?). The Time View dimension has one level and one hierarchy with three attributes:<br /><ul><li>Long Label</li><li>Short Label</li><li>Default sort order</li></ul><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiksgR-dODUFOAvevAR9hS4H8zLbA-vC3iuWNgDGZPioupVeMzFXpxl4cHbRlohc4qOszE7Sj1fCgenxa7lRwUzZz4TTWVqg107GEo1BYOGzbKx9c2UzurcXNuy-i-RuhA72G2CUyyEoGY/s1600-h/Image1.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiksgR-dODUFOAvevAR9hS4H8zLbA-vC3iuWNgDGZPioupVeMzFXpxl4cHbRlohc4qOszE7Sj1fCgenxa7lRwUzZz4TTWVqg107GEo1BYOGzbKx9c2UzurcXNuy-i-RuhA72G2CUyyEoGY/s400/Image1.JPG" alt="" id="BLOGGER_PHOTO_ID_5182076164543605058" border="0" /></a><br /><br />The source data looks like this:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnLFUBNaPqwB1-iGWBEhU8XMIhP_bCYf751nIv5bsaZbrHK-pBUbRDqlK0eTPIj3iv-h6SS6uO5Uj4YoXusblbAWGFNkuJEBXhehfKpQ2CBqMpfeZYIzyehEoILv_mTGTVwXEJrYxsvS0/s1600-h/Image2.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnLFUBNaPqwB1-iGWBEhU8XMIhP_bCYf751nIv5bsaZbrHK-pBUbRDqlK0eTPIj3iv-h6SS6uO5Uj4YoXusblbAWGFNkuJEBXhehfKpQ2CBqMpfeZYIzyehEoILv_mTGTVwXEJrYxsvS0/s400/Image2.JPG" alt="" id="BLOGGER_PHOTO_ID_5182076813083666786" border="0" /></a><br /><br />With the source table definition as follows:<br /><span style="font-size:85%;"><br /><span style="font-family:courier new;">CREATE TABLE TIME_VIEW </span><br /><span style="font-family:courier new;"> (TIME_VIEW_ID VARCHAR2(2 BYTE), </span><br /><span style="font-family:courier new;"> TIME_VIEW_DESC VARCHAR2(35 BYTE), </span><br /><span style="font-family:courier new;"> SORT_ORDER NUMBER(*,0)</span><span style="font-family:courier new;">)</span><span style="font-family:courier new;">;</span><br /></span><br />And the view definition as follows:<br /><span style="font-size:85%;"><br /><span style="font-family:courier new;">CREATE OR REPLACE FORCE VIEW VW_TIME_VIEW AS </span><br /><span style="font-family:courier new;">SELECT<br />TIME_VIEW_ID<br />, TIME_VIEW_DESC<br />, SORT_ORDER<br />FROM TIME_VIEW<br />ORDER BY SORT_ORDER;</span><br /></span><br />To populate the base table the following commands are used:<br /><span style="font-size:85%;"><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('1', 'Current Period', '1')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('2', 'Last Year', '2')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('3', 'Last Year %', '3')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('4', 'Prior Period', '4')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('5', 'Prior Period %', '5')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('6', 'Year To Date', '6')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('7', 'Year To Date Last Year', '7')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('8', 'Year To Date Last Year %', '8')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('9', 'Quarter To Date', '9')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('10', 'Quarter To Date Last Year', '10')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('11', 'Quarter To Date Last Year %', '11')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('12', '3-Month Moving Average', '12')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('13', '6-Month Moving Average', '13')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('14', '12-Month Moving Average', '14')</span></span><br /><br />After this, the next set of values depends on the dimensions within your data model. For my model, I have three additional dimensions that I want to analyze: Channel, Product and Customer. For each of these dimensions I want to see the % share of each member in relation to the value for all members (i.e. the top level) and the shared based on the parent value. To enable these calculations I add the following lines to the TIME_VIEW table:<br /><br /><span style="font-size:85%;"><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('15', ' Product Share of All Products', '15')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('16', ' Product Share of Parent', '16')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('17', ' Channel Share of All Channels', '17')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('18', ' Channel Share of Parent', '18')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('19', ' Customer Share of All Customers', '19')</span><br /><span style="font-family:courier new;">INSERT INTO TIME_VIEW VALUES ('20', ' Customer Share of Parent', '20')</span></span><br /><br />(Obviously, these additional share calculations are not really related to time, so using the name Time View is sort of confusing and in hindsight the term <span style="font-style: italic;">Measure View</span> would have been a better name for the dimension). Once the table has been defined, it can be mapped in AWM to create the dimension mapping (in this case I am using a view over the source<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbuSxTmle0tk3J45KfZXWfhQkAIPbdlupmddRB-JGNKbYT5zCqPSpJeJgJUJwgCNpxTn2shTZgVfLSgiSdkb2njNUsyAV_SZzPBawVnCxpHgyO-gSqjukh8Uc95JFLFes1eQ2c_ZNil-0/s1600-h/Image3.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbuSxTmle0tk3J45KfZXWfhQkAIPbdlupmddRB-JGNKbYT5zCqPSpJeJgJUJwgCNpxTn2shTZgVfLSgiSdkb2njNUsyAV_SZzPBawVnCxpHgyO-gSqjukh8Uc95JFLFes1eQ2c_ZNil-0/s400/Image3.JPG" alt="" id="BLOGGER_PHOTO_ID_5182076971997456754" border="0" /></a><br /><br />The last part of this step is to then load the members into the dimension using the dimension data load wizard or via the SQL command line using a load script. The result should look like this when you view the members using the Dimension Data Viewer:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9rNh-7G-hwr0SDFtbOKqlDaR57Z4TQqTyhWdiHqyr37N3ZzV88dm_SDM64zH2aX40XR1TBpeqPlNvr_1SJ7lERt3f3JT_9OxNpYibMqAo7N4jHUPsi5bMwvYtqcaBPgvlRbTdyJD4sDk/s1600-h/Image3a.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9rNh-7G-hwr0SDFtbOKqlDaR57Z4TQqTyhWdiHqyr37N3ZzV88dm_SDM64zH2aX40XR1TBpeqPlNvr_1SJ7lERt3f3JT_9OxNpYibMqAo7N4jHUPsi5bMwvYtqcaBPgvlRbTdyJD4sDk/s400/Image3a.JPG" alt="" id="BLOGGER_PHOTO_ID_5182077113731377538" border="0" /></a><br /><br />As can be seen here, there are fourteen base calculations that can be applied to any model, plus the additional share calculations that are based on the dimensions within the source cube. Hence the title “IOGALFF” – install one get fourteen free. In reality it is more like: install one and as many calculations as you like or need, but that translates to “IOGASMAYNORL” which does not really role off the tongue.<br /><br /><span style="font-weight: bold;">Step 2 – Updating the Time Dimension with new Attributes.</span><br /><br />To make the program that delivers all these calculated measures as simple as possible a number of attributes are added to the time dimension:<br /><ul><li>Lag Prior Year</li><ul><li>At the Year level this equates to 1</li></ul><ul><li>At the Quarter level this equates to 4</li></ul><ul><li>At the Month level this equates to 12</li></ul><ul><li>At the Day level it is the number of days in the year (365 or 366)</li></ul><li>Parent Quarter</li><ul><li>This is the quarter for each time period and used as the reset trigger for the cumulative totals</li></ul><li>Parent Year</li><ul><li>This is the year for each time period and used as the reset trigger for the cumulative totals</li></ul></ul><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6AuUNjbh57uy9RMUR_Ao4oYE4585ASCNMTkhH2JKarss3tY5oza4sgR662GRAYe89wcXVP2HnJe-74WaD6w99EVomS8A6I6oHDHV6zFGyGp9xncsF_9sg4l30yEqQFP_fLItLS8TxJYw/s1600-h/Image4.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6AuUNjbh57uy9RMUR_Ao4oYE4585ASCNMTkhH2JKarss3tY5oza4sgR662GRAYe89wcXVP2HnJe-74WaD6w99EVomS8A6I6oHDHV6zFGyGp9xncsF_9sg4l30yEqQFP_fLItLS8TxJYw/s400/Image4.JPG" alt="" id="BLOGGER_PHOTO_ID_5182078101573855634" border="0" /></a><br /><br />The information for the two parent attributes is taken from existing columns within the source data since this information already exists and the Lag Prior Year is a simple hard-coded value apart from the day level where the timespan value for the year is used to cope with leap years. Therefore, all the information for these three attributes should be readily available within your source data, especially if you are using the OWB Time Wizard to create your time dimension. Obviously using a view over the source table for the mapping within AWM makes adding this information relatively trivial.<br /><br /><span style="font-weight: bold;">Step 3 – Create the OLAP DML Calculation Program.</span><br /><br />The new OLAP DML program, called TIME_VIEW_PRG (again feel free to change the name of program if you want), takes two arguments:<br /><ul><li>The cube.measure_name for the base measure, in this case SALES_M1, which is the Revenue measure in the SALES cube.</li><li>The identifier for the calculated measure within the REPORT_CUBE cube, which in this case is M1_PRG (this is explained in more detail in the next section)<br /></li></ul>The program code is as follows, which for those of you familiar with OLAP DML will find relatively easy to understand:<br /><br /><span style="font-size:85%;"><span style="font-family:courier new;">DEFINE TIME_VIEW_PRG PROGRAM DECIMAL</span><br /><span style="font-family:courier new;">argument T_MEASURE text " Full measure name including cube name</span><br /><span style="font-family:courier new;">argument T_MEASURE_ID text " Measure name</span><br /><br /><span style="font-family:courier new;">variable T_FORM text " Name of the formula</span><br /><span style="font-family:courier new;">variable T_TIME_VIEW text " Value of TIME_VIEW dimension</span><br /><span style="font-family:courier new;">variable D_RETURN decimal " Return value</span><br /><br /><span style="font-family:courier new;">trap on ALLDONE noprint</span><br /><br /><span style="font-family:courier new;">T_TIME_VIEW = TIME_VIEW</span><br /><span style="font-family:courier new;">T_FORM = joinchars('REPORT_CUBE_', T_MEASURE_ID)</span><br /><br /><span style="font-family:courier new;">switch T_TIME_VIEW</span><br /><span style="font-family:courier new;">do</span><br /><span style="font-family:courier new;"> case 'VL1_1':</span><br /><span style="font-family:courier new;"> D_RETURN = &T_MEASURE</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_2': "LY</span><br /><span style="font-family:courier new;"> D_RETURN = lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_3': "LY%</span><br /><span style="font-family:courier new;"> D_RETURN = lagpct(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_4': "PP</span><br /><span style="font-family:courier new;"> D_RETURN = lag(&T_FORM(TIME_VIEW 'VL1_1'), 1, TIMES, LEVELREL TIMES_LEVELREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_5': "PP%</span><br /><span style="font-family:courier new;"> D_RETURN = lagpct(&T_FORM(TIME_VIEW 'VL1_1'), 1, TIMES, LEVELREL TIMES_LEVELREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_6': "YTD</span><br /><span style="font-family:courier new;"> if TIMES_LEVELREL EQ 'YEAR'</span><br /><span style="font-family:courier new;"> then D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')</span><br /><span style="font-family:courier new;"> else D_RETURN = cumsum(&T_FORM(TIME_VIEW 'VL1_1'), TIMES, TIMES_PARENT_YEAR)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_7': "YTD LY</span><br /><span style="font-family:courier new;"> if TIMES_LEVELREL EQ 'YEAR'</span><br /><span style="font-family:courier new;"> then D_RETURN = lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL)</span><br /><span style="font-family:courier new;"> else D_RETURN = cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_YEAR)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_8': "YTD LY%</span><br /><span style="font-family:courier new;"> D_RETURN = (&T_FORM(TIME_VIEW 'VL1_6')-cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_YEAR))/cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_YEAR)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_9': "QTD</span><br /><span style="font-family:courier new;"> if TIMES_LEVELREL EQ 'YEAR'</span><br /><span style="font-family:courier new;"> then D_RETURN = NA</span><br /><span style="font-family:courier new;"> else if TIMES_LEVELREL EQ 'QUARTER'</span><br /><span style="font-family:courier new;"> then D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')</span><br /><span style="font-family:courier new;"> else if TIMES_LEVELREL EQ 'MONTH'</span><br /><span style="font-family:courier new;"> then D_RETURN = cumsum(&T_FORM(TIME_VIEW 'VL1_1'), TIMES, TIMES_PARENT_QUARTER)</span><br /><span style="font-family:courier new;"> else if TIMES_LEVELREL EQ 'DAY'</span><br /><span style="font-family:courier new;"> then D_RETURN = cumsum(&T_FORM(TIME_VIEW 'VL1_1'), TIMES, TIMES_PARENT_QUARTER)</span><br /><span style="font-family:courier new;"> else D_RETURN = NA</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_10': "QTD LY</span><br /><span style="font-family:courier new;"> if TIMES_LEVELREL EQ 'YEAR'</span><br /><span style="font-family:courier new;"> then D_RETURN = NA</span><br /><span style="font-family:courier new;">else if TIMES_LEVELREL EQ 'QUARTER'</span><br /><span style="font-family:courier new;"> then D_RETURN = cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_QUARTER)</span><br /><span style="font-family:courier new;"> else if TIMES_LEVELREL EQ 'MONTH'</span><br /><span style="font-family:courier new;"> then D_RETURN = cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_QUARTER)</span><br /><span style="font-family:courier new;"> else if TIMES_LEVELREL EQ 'DAY'</span><br /><span style="font-family:courier new;"> then D_RETURN = cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_QUARTER)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_11': "QTD LY%</span><br /><span style="font-family:courier new;"> if TIMES_LEVELREL EQ 'YEAR'</span><br /><span style="font-family:courier new;"> then D_RETURN = NA</span><br /><span style="font-family:courier new;">else if TIMES_LEVELREL EQ 'QUARTER'</span><br /><span style="font-family:courier new;"> then D_RETURN = (&T_FORM(TIME_VIEW 'VL1_9')-cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_QUARTER))/cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_QUARTER)</span><br /><span style="font-family:courier new;"> else if TIMES_LEVELREL EQ 'MONTH'</span><br /><span style="font-family:courier new;"> then D_RETURN = (&T_FORM(TIME_VIEW 'VL1_9')-cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_QUARTER))/cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_QUARTER)</span><br /><span style="font-family:courier new;"> else if TIMES_LEVELREL EQ 'DAY'</span><br /><span style="font-family:courier new;"> then D_RETURN = (&T_FORM(TIME_VIEW 'VL1_9')-cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_QUARTER))/cumsum(lag(&T_FORM(TIME_VIEW 'VL1_1'), TIMES_LAG_PRIOR_YEAR, TIMES, LEVELREL TIMES_LEVELREL), TIMES, TIMES_PARENT_QUARTER)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_12': "3MMA</span><br /><span style="font-family:courier new;"> if TIMES_LEVELREL eq 'MONTH'</span><br /><span style="font-family:courier new;"> then D_RETURN = MOVINGAVERAGE(&T_FORM(TIME_VIEW 'VL1_1'), -2, 0, 1, TIMES, LEVELREL TIMES_LEVELREL)</span><br /><span style="font-family:courier new;"> else D_RETURN = NA</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_13': "6MMA</span><br /><span style="font-family:courier new;"> if TIMES_LEVELREL eq 'MONTH'</span><br /><span style="font-family:courier new;"> then D_RETURN = MOVINGAVERAGE(&T_FORM(TIME_VIEW 'VL1_1'), -5, 0, 1, TIMES, LEVELREL TIMES_LEVELREL)</span><br /><span style="font-family:courier new;"> else D_RETURN = NA</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_14': "12MMA</span><br /><span style="font-family:courier new;"> if TIMES_LEVELREL eq 'MONTH'</span><br /><span style="font-family:courier new;"> then D_RETURN = MOVINGAVERAGE(&T_FORM(TIME_VIEW 'VL1_1'), -11, 0, 1, TIMES, LEVELREL TIMES_LEVELREL)</span><br /><span style="font-family:courier new;"> else D_RETURN = NA</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_15': "Product Share of All Products</span><br /><span style="font-family:courier new;"> D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')/&T_FORM(TIME_VIEW 'VL1_1', PRODUCTS limit(PRODUCTS to TOPANCESTORS using PRODUCTS_PARENTREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_16': "Product Share of Parent</span><br /><span style="font-family:courier new;"> D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')/&T_FORM(TIME_VIEW 'VL1_1', PRODUCTS PRODUCTS_PARENTREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_17': "Customers Share of All Customers</span><br /><span style="font-family:courier new;"> D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')/&T_FORM(TIME_VIEW 'VL1_1', CUSTOMERS limit(CUSTOMERS to TOPANCESTORS using CUSTOMERS_PARENTREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_18': "Customers Share of Parent</span><br /><span style="font-family:courier new;"> D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')/&T_FORM(TIME_VIEW 'VL1_1', CUSTOMERS CUSTOMERS_PARENTREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_19': "Channels Share of All Channels</span><br /><span style="font-family:courier new;"> D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')/&T_FORM(TIME_VIEW 'VL1_1', CHANNELS limit(CHANNELS to TOPANCESTORS using CHANNELS_PARENTREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_20': "Channels Share of Parent</span><br /><span style="font-family:courier new;"> D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')/&T_FORM(TIME_VIEW 'VL1_1', CHANNELS CHANNELS_PARENTREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;">doend</span><br /><br /><br /><span style="font-family:courier new;">ALLDONE:</span><br /><span style="font-family:courier new;">return D_RETURN</span><br /><span style="font-family:courier new;">END</span><br /></span><br />In simple terms, the program checks to see which member of the dimension TIME_VIEW is being requested and then executes the correct OLAP function to return the required data. At the moment this has only been tested on a Julian calendar hierarchy but I am doing some more testing over the next few weeks for other types of hierarchies. Some of the measures are dependant on the level within the Time dimension, so you may need to change references to specific level names etc if you want to reuse this program code. For example:<br /><span style="font-size:85%;"><br /><span style="font-family:courier new;"> if TIMES_LEVELREL EQ 'YEAR'</span></span><br /><br />My time dimension has levels; Year, Quarter, Month, and Day. In some cases it is necessary to change the processing depending the level, for example:<br /><br /><span style=";font-family:courier new;font-size:85%;" > if TIMES_LEVELREL EQ 'YEAR'<br />then D_RETURN = NA<br />else if TIMES_LEVELREL EQ 'QUARTER'<br />then D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')<br />else if TIMES_LEVELREL EQ 'MONTH'<br />then D_RETURN = cumsum(&T_FORM(TIME_VIEW 'VL1_1'), TIMES, TIMES_PARENT_QUARTER)<br />else if TIMES_LEVELREL EQ 'DAY'<br />then D_RETURN = cumsum(&T_FORM(TIME_VIEW 'VL1_1'), TIMES, TIMES_PARENT_QUARTER)<br />else D_RETURN = NA<br /></span><br /><br />In this code extract you can see the reference to one of the additional time attributes we added in the previous step, PARENT_QUARTER that is used by the program. All the references within the program are based on Standard Form naming conventions. Therefore, the full standard name for this attribute is TIMES_PARENT_QUARTER since the dimension is called TIMES and the attribute is called PARENT_QUARTER.<br /><br />For simplicity I created the program in the AW containing the cubes, which is not exactly ideal because if you delete the AW to rebuild it you will lose the program code. Alternatively, you can just create a new AW and add the program to the new AW then modify the ONTTACH program in your data AW to automatically attach the program AW.<br /><br />Calculations for dimension members VL_15 to VL_20 are provided as examples and would need to be changed to match the dimensions within your own AWs. For each dimension you will need to create two new dimension members within the TIME_VIEW dimension to return the following share calculations:<br /><ul><li>Share of based on the top level total, i.e. All Members</li><li>Share based on parent.</li></ul>As the code uses Standard form notation the only thing you should need to change is code highlighted in bold and replace the phrase “Channels” with your own dimension name:<br /><br /><span style="font-size:85%;"><span style="font-family:courier new;"> case 'VL1_19': "Channels Share of All Channels</span><br /><span style="font-family:courier new;"> D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')/&T_FORM(TIME_VIEW 'VL1_1', CHANNELS limit(CHANNELS to TOPANCESTORS using CHANNELS_PARENTREL)</span><br /><span style="font-family:courier new;"> break</span><br /><span style="font-family:courier new;"> case 'VL1_20': "Channels Share of Parent</span><br /><span style="font-family:courier new;"> D_RETURN = &T_FORM(TIME_VIEW 'VL1_1')/&T_FORM(TIME_VIEW 'VL1_1', CHANNELS CHANNELS_PARENTREL)</span><br /><span style="font-family:courier new;"> break</span><br /></span><br /><br /><span style="font-weight: bold;">Step 4 – Creating the New Cube.</span><br /><br />In my demo schema I have a cube called SALES and it contains two measures: Revenue (called M1) and Quantity (called M2). The dimensionality for this cube is Time, Channel Product, and Customer.<br /><br />To provide all the time series and comparative calculations I create a new cube that has the same dimensionality as the SALES cube, with one additional dimension. In this cube the Time View dimension is also used. This reporting cube contains no stored measures, but it does contain custom calculated measures for each measure in the SALES cube, however, each calculated measure will return 14 additional time calculations and 6 share calculations to support the base measure controlled by the dimension TIME_VIEW.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4F-ky1V55QzyppVZUzYMgvL7Rp9XO5TYToRSg8eMA4lx9mkYDOrkXQugwTbk5b5wikCMMKeAMPctoV4AW38Ymmi3y8MlprU3EiTVZGAjFmRa9DWyCYJD_BjwoB0swwWkfTHav9NkPO7A/s1600-h/Image5.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4F-ky1V55QzyppVZUzYMgvL7Rp9XO5TYToRSg8eMA4lx9mkYDOrkXQugwTbk5b5wikCMMKeAMPctoV4AW38Ymmi3y8MlprU3EiTVZGAjFmRa9DWyCYJD_BjwoB0swwWkfTHav9NkPO7A/s400/Image5.JPG" alt="" id="BLOGGER_PHOTO_ID_5182079463078488482" border="0" /></a><br /><br />The implementation for the cube is largely irrelevant since no stored measures will be present within the cube, only calculated measures. Therefore, you can if you want either accept the default settings or de-select all the various options.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfCFbc-OgRq6jXdQaiDTKw7jnYL_aumZk5WleVUqE2yLdLn-KmT7TPfAAAfas0ptLyc5weIsT4DG8p-pwFUb4RVlvL-BtAOhn96JBjB8atnAvmmLRB2pa7HCqbGO6SzHDRDH0xvJLSNXA/s1600-h/Image5a.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfCFbc-OgRq6jXdQaiDTKw7jnYL_aumZk5WleVUqE2yLdLn-KmT7TPfAAAfas0ptLyc5weIsT4DG8p-pwFUb4RVlvL-BtAOhn96JBjB8atnAvmmLRB2pa7HCqbGO6SzHDRDH0xvJLSNXA/s400/Image5a.JPG" alt="" id="BLOGGER_PHOTO_ID_5182080098733648306" border="0" /></a><br /><br />To add the calculated measures to the cube requires the use of a custom measure XML template. To create a calculated measure to support the measure “Revenue” from the SALES cube you will need to create a custom calculation either using an XML template (email me I can send you a blank template) or use the Excel Calculation Utility that can be downloaded from the OLAP Home Page on OTN to install the two custom calculations.<br /><br />Once you have added these calculated measures to the REPORT_CUBE, the tree in AWM should look like this:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQUJzHqPBEiFL-vTqVDgx3WTFByRHShB8gxbt7OIKYAwozP_TXWNJpHIaI3wxOngTXK84bP5xiLttw1rsOZEosFDeErrb9lp-ipxEtBPpucvICb12UoplKzT_Pv-J2-psKT9FT5GCcpOA/s1600-h/Image7.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQUJzHqPBEiFL-vTqVDgx3WTFByRHShB8gxbt7OIKYAwozP_TXWNJpHIaI3wxOngTXK84bP5xiLttw1rsOZEosFDeErrb9lp-ipxEtBPpucvICb12UoplKzT_Pv-J2-psKT9FT5GCcpOA/s400/Image7.JPG" alt="" id="BLOGGER_PHOTO_ID_5182081537547692482" border="0" /></a><br /><br />By selecting each of the calculated measures, the details of each calculation will be displayed within the right-hand panel of AWM. For the first calculated measure linked the Revenue measure in the Sales cube the panel looks like this:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIvakMOTrmEdJMDBBRMNxK1MsPkCzsaFojkvMSvsaynD6Ll52yP2qq883GqVP5dfQe26a08oFmwbgnBu4IeDEfJyo-tze-qKxNGpjU1Q7uM_QOqNjw4GEO9rHrQTCCsVsUUyrbEL_Q5UE/s1600-h/Image8.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIvakMOTrmEdJMDBBRMNxK1MsPkCzsaFojkvMSvsaynD6Ll52yP2qq883GqVP5dfQe26a08oFmwbgnBu4IeDEfJyo-tze-qKxNGpjU1Q7uM_QOqNjw4GEO9rHrQTCCsVsUUyrbEL_Q5UE/s400/Image8.JPG" alt="" id="BLOGGER_PHOTO_ID_5182081705051417042" border="0" /></a><br /><br />For the second calculated measure linked the Quantity measure in the Sales cube the panel looks like this:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDj1CB9FGk1axQfHkdBtr8Jdu_PGP5wllAF238sbB2pUeq53ApoScYdCj4t_XZwNrYIOaursxNRmnbN2Z6OE3yJCU4Z1JkE5wyxgF7eMXForWyC1VrOZpsofadkcgeYLEhN4Y8Z1owo7U/s1600-h/Image9.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDj1CB9FGk1axQfHkdBtr8Jdu_PGP5wllAF238sbB2pUeq53ApoScYdCj4t_XZwNrYIOaursxNRmnbN2Z6OE3yJCU4Z1JkE5wyxgF7eMXForWyC1VrOZpsofadkcgeYLEhN4Y8Z1owo7U/s400/Image9.JPG" alt="" id="BLOGGER_PHOTO_ID_5182081803835664866" border="0" /></a><br /><br />The key part is the line showing the “Expression” (in the XML Template this is the attribute ExpressionText), this defines the call to an OLAP DML program called TIME_VIEW_PRG passing the two required arguments of<br /><br /><span style="font-size:85%;"><span style="font-family:courier new;"> ExpressionText="TIME_VIEW_PRG('SALES_M1', 'M1_PRG')”</span></span><br /><ul><li>The cube.measure_name for the base measure, in this case SALES_M1, which is the Revenue measure in the SALES cube.</li><li>The identifier for the calculated measure within the REPORT_CUBE cube.</li></ul>At this point you may or may not have the correct formula/expression text. When you load calculations via the XML interface OLAP tries to be a bit too clever and it attempts to convert any physical name it can match with the equivalent standard form name. In most cases this is fine, but in this case we need to refer directly to the physical objects. Modifying the expressions is relatively easy if you follow these steps. Using AWM, open the OLAP Worksheet and then:<br /><ol style="font-family:courier new;"><li><span style="font-size:85%;">CNS REPORT_CUBE_M1_PRG</span></li><li><span style="font-size:85%;">EQ </span><span style="font-size:85%;">TIME_VIEW_PRG('SALES_M1', 'M1_PRG')</span></li><li><span style="font-size:85%;">UPDATE</span></li><li><span style="font-size:85%;">COMMIT</span></li><li><span style="font-size:85%;">CNS REPORT_CUBE_M2_PRG</span></li><li><span style="font-size:85%;">EQ </span><span style="font-size:85%;">TIME_VIEW_PRG('SALES_M2', 'M2_PRG')</span></li><li><span style="font-size:85%;">UPDATE</span></li><li><span style="font-size:85%;">COMMIT</span></li></ol><br /><br />If want to do this via the PL/SQL interface then you can do something like this:<br /><span style="font-size:85%;"><br /><span style="font-family:courier new;">EXEC DBMS_AW.EXECUTE('AW ATTACH AW_NAME RW FIRST')</span><br /><span style="font-family:courier new;">EXEC DBMS_AW.EXECUTE('CNS REPORT_CUBE_M1_PRG')</span><br /><span style="font-family:courier new;">EXEC DBMS_AW.EXECUTE('EQ TIME_VIEW_PRG(''SALES_M1'', ''M1_PRG'')')</span><br /><span style="font-family:courier new;">EXEC DBMS_AW.EXECUTE('UPDATE')</span><br /><span style="font-family:courier new;">EXEC DBMS_AW.EXECUTE('COMMIT')</span><br /><span style="font-family:courier new;">EXEC DBMS_AW.EXECUTE('CNS REPORT_CUBE_M2_PRG')</span><br /><span style="font-family:courier new;">EXEC DBMS_AW.EXECUTE('EQ TIME_VIEW_PRG(''SALES_M2'', ''M2_PRG'')')</span><br /><span style="font-family:courier new;">EXEC DBMS_AW.EXECUTE('UPDATE')</span><br /><span style="font-family:courier new;">EXEC DBMS_AW.EXECUTE('COMMIT')</span><br /><span style="font-family:courier new;">EXEC DBMS_AW.EXECUTE('AW DETACH AW_NAME') </span></span><br /><br /><br /><span style="font-weight: bold;">Step 4a – Viewing the Data.</span><br /><br />Once the calculated measures have been added to the new cube, REPORT_CUBE, the AWM Data Viewer can be launched to check the results:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfl3HAHgsKALlKPQWQKJdVrZQhxCXInHgn_2TmDsrQhfkqpqPC3dfilQB6f-9LRhjC1PRCZYfsREPQ6ArlyC6o5NFc1Ky6xJlYgKabdYmRukGRDotJBieIDqzA6OkabV7GoKJvinW_h7E/s1600-h/Image10A.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfl3HAHgsKALlKPQWQKJdVrZQhxCXInHgn_2TmDsrQhfkqpqPC3dfilQB6f-9LRhjC1PRCZYfsREPQ6ArlyC6o5NFc1Ky6xJlYgKabdYmRukGRDotJBieIDqzA6OkabV7GoKJvinW_h7E/s400/Image10A.JPG" alt="" id="BLOGGER_PHOTO_ID_5182082710073764338" border="0" /></a><br /><br />In the Query Wizard both sets of measures (stored measures and the new calculated measures) are both available for selection. To see the new calculations that are now available we can select both of the Report View measures as shown here.<br /><br />Once the measures have been selected, the dimension selector will allow us to pick the calculations we want to display from the list of twenty (there are fourteen base calculations that can be applied to any model, plus the additional share calculations that are based on the dimensions within the source cube, in this case six additional share calculations, making twenty calculated measures in total).<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1WCpEdYAI5P7Hr6qPj7XfknvxbT1xRsG3o7JMKDuXXIcKuspX5QboT1AwHtEeHqMo2NazStLw9WomomctxHEHBWSpdgDB9JlQk8dyPpxOoGlllSYnSAgeGvm6HWftCb09pQaEJI15LO0/s1600-h/Image10B.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1WCpEdYAI5P7Hr6qPj7XfknvxbT1xRsG3o7JMKDuXXIcKuspX5QboT1AwHtEeHqMo2NazStLw9WomomctxHEHBWSpdgDB9JlQk8dyPpxOoGlllSYnSAgeGvm6HWftCb09pQaEJI15LO0/s400/Image10B.JPG" alt="" id="BLOGGER_PHOTO_ID_5182082933412063746" border="0" /></a><br /><br />The Dimension Viewer shows all the available calculations for this demo schema and the final report is shown below.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjru_W5zJgZJbk8gqj-rvgMNqj2BjY36G5tspbI59juuTJWzIHZ4Sa5BFmjg3A1lLMTgCfiq8alHw_XgetShaJC4hByxEwspykE7kgbqUnP-kL90rkWKmJrbVnTQe751oR-XztlqZQ5ZUA/s1600-h/Image11.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjru_W5zJgZJbk8gqj-rvgMNqj2BjY36G5tspbI59juuTJWzIHZ4Sa5BFmjg3A1lLMTgCfiq8alHw_XgetShaJC4hByxEwspykE7kgbqUnP-kL90rkWKmJrbVnTQe751oR-XztlqZQ5ZUA/s400/Image11.JPG" alt="" id="BLOGGER_PHOTO_ID_5182083109505722898" border="0" /></a><br /><br /><br /><span style="font-weight: bold;">Step 5 – Making the Data Available via SQL.</span><br />Is there any real point to this post except to show how clever Oracle OLAP can be? In opinion yes, since this technique can be extremely useful when you need to make an OLAP cube visible to SQL based tools. Analytic Workspace Manager 10g has an relational view generator that is available as a plugin and this makes generating the SQL views to support your OLAP cubes a very quick and easy process. But there we know users don’t just want base measures they want lots and lots of calculations as well. When the time comes to create SQL views as the limit on the number of columns within a view is 1000. This may have been increased in 10g/11g, but even so, navigating a cube with that many columns is not easy.<br /><br />The OLAP View Generator plugin for AWM10gR2 can be downloaded from <a href="http://www.oracle.com/technology/products/bi/olap/viewGenerator_1_0_2.zip">here</a>, and the associated readme is <a href="http://www.oracle.com/technology/products/bi/olap/ViewGenerator.html">here</a>.<br /><br />Using this model, the calculations simply resolve to another dimension, which translates to one additional column in the view as opposed to, at least, 14 additional columns per source measure and in this case 20 additional columns per source measure. Therefore, this approach makes exposing the cube much easier to manage as can be seen here:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMnmCrOosZygpoywmF5nN9sITJ2sk2EAmphTO6yVDqev5cITT-a6cVUh9BJlfvrOPGlMZ-X94gznUC3PcYfDHvP6gDlyzTlHdFAR3bZY-UKna3QK2b0uEawm9ckVfXB13bkjq_dXRjgeI/s1600-h/Image12.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMnmCrOosZygpoywmF5nN9sITJ2sk2EAmphTO6yVDqev5cITT-a6cVUh9BJlfvrOPGlMZ-X94gznUC3PcYfDHvP6gDlyzTlHdFAR3bZY-UKna3QK2b0uEawm9ckVfXB13bkjq_dXRjgeI/s400/Image12.JPG" alt="" id="BLOGGER_PHOTO_ID_5182083315664153122" border="0" /></a><br /><br />As we can see here, all the calculations are contained within the dimension Time View, which simply gets exposed like any other dimension.<br /><br />Eh voila, install one measure and you can automatically generate fourteen or more additional measures which are guaranteed to bring a smile to the face of any business user.Keith Lakerhttp://www.blogger.com/profile/01039869313455611230noreply@blogger.com2tag:blogger.com,1999:blog-3820031471524503731.post-35031989649570317672008-03-07T21:00:00.000-08:002008-12-11T15:25:37.789-08:00OLAP Workshop 7 : Creating Calculated MeasuresMost data warehouses contain a lot of data but also conversely contain very little information. Many DW teams are content to publish basic facts to their user communities and then leave those communities to fend for themselves in turning data into information. For example, it is not uncommon to see basic measures such as sales, costs, and stock in many data warehouse schemas, but in reality these types of measures are completely useless in themselves. Business users are not interested per se in the value of sales today and this can be seen in the general press as well when reporting key trading periods such as Thanksgiving in the US and Christmas in Europe. Both business and financial communities are both more interested in sales compared to the same time last year, rate of growth of sales, sales compared to forecast. In other words most people are actually interested in calculated measures such as ratios and percentages derived from the base data.<br /><br />Therefore, the key question for many data warehouse teams is how to create and manage these types of calculations?<br /><br />In this workshop we will explore some the calculated measures that can be quickly and easily created in your analytic workspace (AW) to enrich its analytic content for end users.<br /><br />One of the powerful features of the Oracle OLAP technology is the ability to efficiently and easily create business calculations. Oracle OLAP contains a powerful calculation engine that allows you to extend the analytic content of your AW by adding into it some useful business calculations as calculated measures. Some of these business calculations are simple and some of are a lot more involved. However, none are complex from an end-user perspective, although many of them are challenging to traditional relational-only databases. This is especially true when the calculations are numerous, and when many of the queries are ad hoc and unpredictable in nature.<br /><br />Calculated measures are, as the name suggests, calculated from other measures available in the AW. They are implemented as formulas in the AW; that is, their definition is saved, but no calculated data is stored. The calculations happen at run time when a query requires it. Calculated measures are derived from the contents of other measures, including stored measures as well as measures that are calculated at run time. The calculated measures that you define in the AW are indistinguishable to end users from the stored measures into which data has been loaded and stored in the AW. All measures, according to the dimensional model presented to the end user, are identical. This promotes ease of use by end users.<br /><br />There is generally a trade-off between precomputing and storing measures in the AW versus calculating them at query time. However, Oracle AWs are very efficient at preserving query performance at very fast levels, even when there are many calculated measures that are resolved dynamically. It is not uncommon for Oracle OLAP customers to implement multidimensional cubes with many hundreds or even thousands of calculated measures and key performance indicators (KPIs), which are calculated at query time from a relatively small number of physically stored and aggregated (or partially aggregated) measures. It is a striking characteristic of AWs in the Oracle database that query performance generally remains consistent even as data volumes and calculation complexity increase.<br /><br />So how do calculated measures works and what happens when the dimensionality of the source measures does not match exactly?<br /><br />In the example below a measure called Revenue is a calculated measure based on two other measures: quantity and price. The calculation itself is simple: quantity × price. Notice that the resulting dimensionality of Revenue is inherited from the two measures involved in the calculation. When you use measures with different dimensionality in a calculation, the result always contains the superset of the dimensions of the base measures. The multidimensional data model handles this automatically. You do not have to worry about the possibility that different measures in your AW have different shapes or dimensionality. You specify the calculation rule in the wizard, and the engine automatically resolves the dimensionality. One obvious requirement is that one dimension must be in common for the result to make sense.<br /><br />In this example, Quantity is dimensioned by Time, Product, and Customer but Unit Price is not dimensioned by Customer. When Oracle OLAP is asked to calculate quantity × price, it uses its knowledge of the dimensional model to automatically handle the calculation of Revenue for all customers, even though there is no separate price stored for each customer. If there is not a separate price for each customer, then there must be a single price for all customers. Price does not vary by customer. As Oracle OLAP performs the calculation quantity × price, it applies the appropriate price for the particular product and time dimension intersections being calculated.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFciYQNkZbL_v9xUjvPCIlJLM_Pc159Yrr_e8mjZMjmhx-42gve0uAqKhuIr9qzPgIVnGFF0AoFtzE49sG4L8kv9LqR_0TWuJDLwV4cmEw7lYy0nUY9VQu4Fr7cYsPbzyPEB9pwDnW90g/s1600-h/image1.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFciYQNkZbL_v9xUjvPCIlJLM_Pc159Yrr_e8mjZMjmhx-42gve0uAqKhuIr9qzPgIVnGFF0AoFtzE49sG4L8kv9LqR_0TWuJDLwV4cmEw7lYy0nUY9VQu4Fr7cYsPbzyPEB9pwDnW90g/s400/image1.JPG" alt="" id="BLOGGER_PHOTO_ID_5174956731896400034" border="0" /></a><br />There are two methods for creating a calculated measure<br /><ul><li>Wizard and template method</li><li>Free format</li></ul><span style="font-size:130%;"><span style="font-weight: bold;">Using the Calculation Wizard</span></span><br />By default both AWM and OWB provide a calculation wizard to help define the most common types of business calculaltions. There are four categories of calculations:<br /><ul><li>Basic</li><li>Advanced</li><li>Prior/Future comparison</li><li>Time Frame</li></ul>The image below shows the wizard screen and the list of templates within each category (Note there are some changes with AWM 11g).<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXZ6cEskPYcO7kIXH7SMJ3jSGA1trjb1PYr3vDAqyGypqd80LLd5GeBZL0C1WqkOPoBNuCoiUMreu9fDG6POQfsdnoWxrc1NbZhEoZafgs6WP7UzpLZRjvpdM6tV63U8Ktr8JaZcVm-K4/s1600-h/image2.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXZ6cEskPYcO7kIXH7SMJ3jSGA1trjb1PYr3vDAqyGypqd80LLd5GeBZL0C1WqkOPoBNuCoiUMreu9fDG6POQfsdnoWxrc1NbZhEoZafgs6WP7UzpLZRjvpdM6tV63U8Ktr8JaZcVm-K4/s400/image2.JPG" alt="" id="BLOGGER_PHOTO_ID_5174957629544564914" border="0" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSVPENpqryLWAD2D1ZCos1QrNxBogOop-q2Cf6_AhhvsDOF_x3bcnLPZDpQu4p8li8yeIjT5ongM8gF9h5kp4ydV6Ds07xb-tpp96DHtxphf3KOGsYUxWnbxegF4Z-ig2iL505UzqATMs/s1600-h/image2a.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSVPENpqryLWAD2D1ZCos1QrNxBogOop-q2Cf6_AhhvsDOF_x3bcnLPZDpQu4p8li8yeIjT5ongM8gF9h5kp4ydV6Ds07xb-tpp96DHtxphf3KOGsYUxWnbxegF4Z-ig2iL505UzqATMs/s400/image2a.JPG" alt="" id="BLOGGER_PHOTO_ID_5174957724033845442" border="0" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEoMiz7fGExiMtpeQhWyv5mz_33JszFOYdLEzSMHi4dujW0KL4KEWFh2uy-7qGWE_EMILn1qLQM2ncOzSd3kZfm2-WlzN6oU8Af3gyHUZ74v-WLtE_kALYOc2sIMF5rmM9I66Gw26xExg/s1600-h/image2b.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEoMiz7fGExiMtpeQhWyv5mz_33JszFOYdLEzSMHi4dujW0KL4KEWFh2uy-7qGWE_EMILn1qLQM2ncOzSd3kZfm2-WlzN6oU8Af3gyHUZ74v-WLtE_kALYOc2sIMF5rmM9I66Gw26xExg/s400/image2b.JPG" alt="" id="BLOGGER_PHOTO_ID_5174957809933191378" border="0" /></a><br /><span style="font-weight: bold;">Creating a Share Calculation</span><br />The Share template prompts you for the components you need to specify the calculation:<br />Share Of: A measure or calculated measure that is dimensioned by the Product dimension (in this example)<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYqyWMHDu1-nQtCnGDMLNvAe2IxQ40_N7msv5rfLDO84P3yBA1tvFbZsLBWZX2RweT3YBiEatlJ3DzI6C_N9kcG1yLrPvPmcucGNPObFu93cvwbfz4MCQ483Mpk6BUL3IU_fi-GBJmWb0/s1600-h/image2c.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYqyWMHDu1-nQtCnGDMLNvAe2IxQ40_N7msv5rfLDO84P3yBA1tvFbZsLBWZX2RweT3YBiEatlJ3DzI6C_N9kcG1yLrPvPmcucGNPObFu93cvwbfz4MCQ483Mpk6BUL3IU_fi-GBJmWb0/s400/image2c.JPG" alt="" id="BLOGGER_PHOTO_ID_5174957891537570018" border="0" /></a><br /><ul><li>For: The dimension for which the share is to be calculated</li><li>In: The hierarchy to be used while calculating the share for the selected dimension</li><li>As a Percent of: The dimension member to be used as a baseline to calculate the share. Select one of the following choices: </li><ul><li>Total: Specifies that the baseline consists of the total of all items on the level that is associated with the current member (that is, the item for which the share is being calculated). This option is disabled for a dimension that has no hierarchies.</li></ul><ul><li>Parent: Specifies that the baseline consists of the total on the level of the parent for the current member (that is, the item for which the share is being calculated). This option is disabled for a dimension that has no hierarchies. </li></ul><ul><li>Level: Specifies that the baseline consists of the total of a level to be specified. Choosing this item requires the selection of a value in the associated drop-down list. This list displays the names of levels from the selected hierarchy for the selected dimension that are available for calculating the share. This option is disabled for a dimension that has no hierarchies. </li></ul><ul><li>Member: Specifies that the baseline consists of the total for a dimension member to be specified. Choosing this item requires the selection of a value in the associated drop-down list. This list displays the names of the dimension members that are available for calculating the share. This type of calculation applies to measures only.</li></ul></ul>Note that although the most common use of this template is to express the share as a “% of Total” or as a “% of Parent” in the chosen hierarchy, a specific member can be used as the baseline of the calculation. This is useful if you want to compare members of the dimension in question to a specific benchmark or model member, such as an established market leading product, flagship store, or key competitor.<br /><br />So, as can be seen with this share calculation template it may be necessary to create multiple calculated measures using the same template to provide different results, such as shown below:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNQi54rUBBNR1kN_Kd2vppGGX_xSqQyZE9IrpoRJSW8t1c5GrxnxzfBHFTwAetpnQ78bShsV8VHcGbw3tDnUpFV3MUqXnxHnzHxOkETVc9oMsvwI9xdDvUx1nJ_SjxxS5fjF6LY4fBKLc/s1600-h/Image14.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNQi54rUBBNR1kN_Kd2vppGGX_xSqQyZE9IrpoRJSW8t1c5GrxnxzfBHFTwAetpnQ78bShsV8VHcGbw3tDnUpFV3MUqXnxHnzHxOkETVc9oMsvwI9xdDvUx1nJ_SjxxS5fjF6LY4fBKLc/s400/Image14.JPG" alt="" id="BLOGGER_PHOTO_ID_5174971841591347570" border="0" /></a><br />This report is showing the Budget Profit base measure and three Share calculations: Share of Product Total, Share of Product Level, and Share of a Product Member (Hardware). Note how the “% of Total,” “% of Level,” and “% of HW ” (hardware) category measures behave differently as the user drills down the product hierarchy. Also note that the third share measure on the report is base-lined to a specific product: the Hardware category. The report shows how Hardware compares to the other categories: Electronics, Peripherals and Accessories, Photo, and Software/Other.<br /><br /><span style="font-weight: bold;">Creating a % Different Prior Period Calculation</span><br />Using the “Percent Difference from Prior Period” calculated measure template, you can create a calculated measure that is useful to indicate growth or decline of a business over time. This calculation template is found in the Prior/Future Time Period calculation type folder. This template accepts input for the following items to calculate the percentage difference from a prior period:<br /><ul><li>Measure: Select a measure or a dimension member for which you want to calculate the percentage difference from the prior period. </li><li>Over: If there is more than one time dimension, then a box appears to enable the selection of the proper Time dimension. Otherwise, the default Time dimension is used. </li><li>In: Select the hierarchy for the specified dimension. </li><li>From: Choose one of the following items to indicate the previous time period that the comparison is to be based on: </li><ul><li>Year ago: Use if your measure is to compare performance with the same time period from the previous year</li></ul><ul><li>Period ago: Use if your measure is to compare performance with the previous period at the same level in the Time hierarchy</li></ul><ul><li>Number of periods or years ago: Use if your measure is to calculate a comparison with a time period of a specified number (entered in the number box) of periods ago, at a particular level (such as Year, Quarter, or Month)</li></ul></ul><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIUnoDGN0GW41KtCt15n1qiv3xUksGT1lePL_AW8qIKeYgAd_GBPJ8CbfQ3FKLbjbOg_ZJvvTrX2A59N6Jkv71UUmHPa77PDYbso0OglzQi8uVz7JMbNfkOiNYcb_C4m2GpCGA1wSqq_8/s1600-h/Image15.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIUnoDGN0GW41KtCt15n1qiv3xUksGT1lePL_AW8qIKeYgAd_GBPJ8CbfQ3FKLbjbOg_ZJvvTrX2A59N6Jkv71UUmHPa77PDYbso0OglzQi8uVz7JMbNfkOiNYcb_C4m2GpCGA1wSqq_8/s400/Image15.JPG" alt="" id="BLOGGER_PHOTO_ID_5174972545965984146" border="0" /></a><br /><br />In a report this would look like this:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkhGF5S1ph2x7AAKGTu72koog4XBDlHn1GLJdFoJ6wUDQEcZAIbM0wgmnr7KmDC7ZeanC-I78MQHhoG9cXjJoLqPOyT7CFojoCqf6cMpiwU4wg-at1EZeoI0SwWC9GilsFwwFoVDQrDM/s1600-h/Image16.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkhGF5S1ph2x7AAKGTu72koog4XBDlHn1GLJdFoJ6wUDQEcZAIbM0wgmnr7KmDC7ZeanC-I78MQHhoG9cXjJoLqPOyT7CFojoCqf6cMpiwU4wg-at1EZeoI0SwWC9GilsFwwFoVDQrDM/s400/Image16.JPG" alt="" id="BLOGGER_PHOTO_ID_5174972421411932546" border="0" /></a><br /><br />This report contains calculations of a number of alternative percentage differences from prior periods. All the measures automatically handle the situation in which the user needs to drill down into the time dimension and look at time periods at different levels. A single calculated measure in the AW can be used at any level of time, by any query tool, including SQL tools.<br /><br />Note the following:<br /><ul><li>The Last Year calculation works at all levels of time, and compares each time period with the same time period 1 year ago.</li><li>The Last Period calculation works at all levels of time, and compares each time period with the previous period at the same level.</li><li>The 3 Months Ago calculation works at the appropriate levels of time (in this case, Month and Quarter because a quarter is made up of three months), and compares each time period with the same time period 3 months ago (which is equivalent to one quarter ago). </li><li>Similar calculations can be easily generated for Costs, Quantity, Profit, and Budget measures.</li></ul><br /><span style="font-weight: bold;">Creating a Moving Average Calculation</span><br />The Moving Average calculated measure template enables you to create moving averages over any of the measures in your AW. Moving averages are very useful when you analyze volatile data, because they smooth out the peaks and troughs and enable you to more easily visualize the trend in data. In the Moving Average template, you are asked to provide the following input:<br /><ul><li>Measure: Select the measure for which you want to calculate a moving average. </li><li>Over Time In: If there is more than one time dimension, then a box appears to enable the selection of the proper time dimension. Otherwise, the default time dimension is used. In identifies the hierarchy for the specified dimension. </li><li>Include Previous: Enter the number of periods to be used for the calculation. </li><li>An example of this calculation is as follows:</li><li>Moving average of sales for the last three months = (Jan sales + Feb sales + March sales) / 3</li></ul>Note: Similar pages are used for Moving Totals, Moving Maximums, and Moving Minimums.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6lYvmRCO3NoF0IR4bA6q34ViiyeMVXsm8aaSL1n3059UaHT0xEs7NSmT4dBE14u0wSFublVObUZ4hTHliQ-clEl1xeZKkLSG8Tf5yFpEeRCSFS3xkyJjS6J9HLI7_LYcu-q9HBOb7dCE/s1600-h/Image17.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6lYvmRCO3NoF0IR4bA6q34ViiyeMVXsm8aaSL1n3059UaHT0xEs7NSmT4dBE14u0wSFublVObUZ4hTHliQ-clEl1xeZKkLSG8Tf5yFpEeRCSFS3xkyJjS6J9HLI7_LYcu-q9HBOb7dCE/s400/Image17.JPG" alt="" id="BLOGGER_PHOTO_ID_5174973263225522594" border="0" /></a><br /><br />Below is a combination graph showing how moving averages can be a useful way of smoothing out volatile data, thus enabling you to see the trends in data more easily.<br />One line is a moving six-month average, and the other line is a three-month average.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMCBRxIjzSjr5Lm-he9fhvGikxeTFTWugAa30uJW-oItQ-Lu0HmmioaYGDODhDEPpi8lzjjeE7VXe3tX7JH_04yjQ3saaLWJI6Xd-JKmexQKO5hTPqtVrggFUG9Wpnd_OgqSu6HVf9ufM/s1600-h/Image18.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMCBRxIjzSjr5Lm-he9fhvGikxeTFTWugAa30uJW-oItQ-Lu0HmmioaYGDODhDEPpi8lzjjeE7VXe3tX7JH_04yjQ3saaLWJI6Xd-JKmexQKO5hTPqtVrggFUG9Wpnd_OgqSu6HVf9ufM/s400/Image18.JPG" alt="" id="BLOGGER_PHOTO_ID_5174973340534933938" border="0" /></a><br /><br /><br /><span style="font-weight: bold;">Modifying a Calculated Measure</span><br />Existing calculated measures can be edited from within AWM 10g. The descriptions and the calculation details can be changed. To change a calculated measure, click the calculated measure in the Model view. You see the general information displayed on the right. You can:<br /><ol><li>Make changes to labels and description. You can change the labels and description, but not the name.</li><li>Click the Launch Calculation Editor button to change the details of the calculated measure. You can change the details, but not the type, of the measure.</li></ol><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPqFLlOHZIlDDiI98rSVOiudX8ish7hnDuYjdFF6wO-KdNCD60u2setL2RJoOi_8kSTEKdRbuOBZveQF_4qdGhbBTIiuUNY8alLXJCWxMQJw0ya0TpBxtGp0H7062ttFz0EujRDsUb8jE/s1600-h/Image19.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPqFLlOHZIlDDiI98rSVOiudX8ish7hnDuYjdFF6wO-KdNCD60u2setL2RJoOi_8kSTEKdRbuOBZveQF_4qdGhbBTIiuUNY8alLXJCWxMQJw0ya0TpBxtGp0H7062ttFz0EujRDsUb8jE/s400/Image19.JPG" alt="" id="BLOGGER_PHOTO_ID_5174973649772579266" border="0" /></a><br /><br /><br /><span style="font-weight: bold;">Managing Calculated Measures</span><br />My recommendation is always to create your calculated measures in a separate cube. This helps insulate you from changes to the physical implementation of your base cubes. For example, if you want to change the storage definition for a cube AWM forces you to delete the cube, which if it contains calculated measures means these are also delete and need to be recreated. By keeping your calculated measures in a separate cube it is possible to delete and a rebuild a cube without impacting the calculated measures. Assuming of course you do not change the dimensionality.<br /><br />There are other ways to resolve this issue (deleting a cube but keeping the calculated measures):<br /><ul><li>Save the calculated measure to an XML template</li><li><span style="font-style: italic;">Hack</span> the XML definition for the cube</li></ul>Saving the calculated measures to an XML file is always a good idea since this creates a backup of the definition. However, you can only save one measure at a time which is fine if you create the XML template when you define the calculated measure but not so good if you have lots and lots of calculated measures in a cube and then you decide to save them all to XML templates.<br /><br />Hacking the XML is not something I would normally recommend, however, it is possible to move calculated measures from one template file to another using notepad. Again, assuming you do not change the dimensionality (as some measures may refer to specific dimensions and/or levels and/or hierarchies) you can cut & paste the XML. The calculated measures are all defined in the last but one block of the XML definition, using the tag “DerivedMeasure”. Simply copy all the DerivedMeasure blocks to your new cube XML template and reload that template to restore all your calculated measures. This works for 10gR2 but has not been tested with 11g.<br /><br /><br /><span style="font-weight: bold;font-size:130%;" >Creating custom calculated Measures</span><br />Oracle OLAP Option has a very powerful calculation engine that supports a huge library of functions:<br /><ul><li>Numeric Functions</li><li>Time Series Functions</li><li>Text Functions</li><li>Financial Functions</li><li>Statistical Functions</li><li>Date and Time Functions</li><li>Aggregation Functions</li><li>Data Type Conversion Functions</li></ul>Any these functions can be used to create a custom calculated measure. To get more information on these various functions you can refer to the Oracle OLAP DML Reference <span style="color: rgb(255, 0, 0); font-weight: bold;">10g</span> Release 2 documentation:<br /><br /><a href="http://download.oracle.com/docs/cd/B19306_01/olap.102/b14346/toc.htm">http://download.oracle.com/docs/cd/B19306_01/olap.102/b14346/toc.htm</a><br /><br />and for <span style="color: rgb(255, 0, 0); font-weight: bold;">11g</span>:<br /><br /><a href="http://download.oracle.com/docs/cd/B28359_01/olap.111/b28126/toc.htm">http://download.oracle.com/docs/cd/B28359_01/olap.111/b28126/toc.htm</a><br /><br />Here is a very simple example of how to create a custom calculated measure. Lets create a measure to show the percent variance for a measure, sales revenue, based on the prior-period. To do this we need to use the lagpct function. The LAGPCT function returns the percentage difference between the value of a dimensioned variable or expression at a specified offset of a dimension prior to the current value of that dimension and the current value of the dimensioned variable or expression.<br /><br />The syntax for the function is :<br /><ul><li>LAGPCT(variable, n, [dimension], [STATUS|NOSTATUS|limit-clause] )</li></ul>Where<br /><ul><li>Variable - A variable or expression that is dimensioned by dimension.</li><li>‘n’ - The offset (that is, the number of dimension values) to lag. LAGPCT uses this value to determine the number of values that LAGPCT should go back in dimension to retrieve the value of variable. Typically, n is a positive INTEGER that indicates the number of time periods (or dimension values) before the current one. When you specify a negative value for n, it indicates the number of time periods after the current one. In this case, LAGPCT compares the current value of the time series with a subsequent value.</li><li>Dimension - The dimension along which the lag occurs. While this can be any dimension, it is typically a hierarchical time dimension of type TEXT that is limited to a single level (for example, the month or year level) or a dimension with a type of DAY, WEEK, MONTH, QUARTER or YEAR. When variable has a dimension with a type of DAY, WEEK, MONTH, QUARTER, or YEAR and you want LAGPCT to use that dimension, you can omit the dimension argument.</li><li>Status can be one of the following:</li><ul><li>STATUS - Specifies that LAGPCT should use the current status list (that is, only the dimension values currently in status in their current status order) when computing the lag.</li></ul><ul><li>NOSTATUS - (Default) Specifies that LAGPCT should use the default status (that is, a list all the dimension values in their original order) when computing the lag.</li></ul><ul><li>limit-clause - Specifies that LAGPCT should use the default status limited by limit-clause when computing the lag. You can use any valid LIMIT clause (see the entry for the LIMIT command for further information). To specify that LAGPCT should use the current status limited by limit-clause when computing the lag, specify a LIMIT function for limit-clause.</li></ul></ul>Based on this syntax, the format of our function would be as follows:<br /><ul style="font-family: courier new;"><li>lagpct(sales_revenue, 1, TIME, LEVELREL TIME_LEVELREL)</li></ul>since sales_revenue is the variable, we need to offset by one period to get the prior period, the dimension for the lag is Time and the limit clause is based on the standard form level object TIME_LEVELREL which ensures the correct prior period is selected based on the level of the dimension member, so months are only compared to months and quarters only compared to quarters and so on.<br /><br /><span style="font-weight: bold;">How do you install a Custom Calculation?</span><br />There are two ways to add a custom calculation to a cube:<br /><ul><li>Special XML Template</li><li>Excel Utility</li></ul>It is possible to use an XML template file to define a custom calculated measure. As we noted in the XML definition of a cube containing a calculated measure the tag “DerivedMeasure” is used to denote a calculated measure. The template needs to have the following fields:<br /><ul><li>Name</li><li>LongName</li><li>ShortName</li><li>PluralName</li><li>Id</li><li>DataType</li><li>IsInternal</li><li>UseGlobalIndex</li><li>ForceCalc</li><li>ForceOrder</li><li>SparseType</li><li>AutoSolve</li><li>IsValid</li><li>ExpressionText</li></ul>So for our example the following entries would be required:<br /><br /><ul><li>Name="SR_PPV_PCT" </li><li>LongName="Sales Revenue Prior Period % Variance" </li><li>ShortName=" Sales Rev Prior Period % Var" </li><li>PluralName=" Sales Revenue Prior Period % Variance"</li><li>Id="SALES.SR_PPV_PCT.MEASURE"</li><li>DataType="Decimal" </li><li>isInternal="false" </li><li>UseGlobalIndex="false" </li><li>ForceCalc="false" </li><li>ForceOrder="false" </li><li>SparseType="STANDARD" </li><li>AutoSolve="DEFAULT" </li><li>IsValid="true" </li><li>ExpressionText=" lagpct(sales_revenue, 1, TIME, LEVELREL TIME_LEVELREL)"/></li></ul><br />Note the following:<br /><br /><ul><li>Name is can must match the “custom_calculated_measure_name” value in the Id tag.</li><li>Id is derived as follows:</li><ul><li>Cube_name.custom_calculated_measure_name.MEASURE</li></ul><li>ExpressionText can refer either to the AWM Object View names or the physical objects from the ModelView. It can be more efficient to refer directly to the stored variables rather than using the standard form objects since this involves and additional layer of processing that is not always necessary. But start by referring to the standard form objects and check query performance before pointing directly to the base storage objects.</li></ul>Fortunately, there is a much easier way to install a custom calculated measure. On OTN there is an Excel utility to that can help. See the link on the OLAP OTN Home Page, “Creating OLAP Calculations using Excel”:<br /><br /><a href="http://download.oracle.com/otn/java/olap/SpreadsheetCalcs_10203.zip">http://download.oracle.com/otn/java/olap/SpreadsheetCalcs_10203.zip<br /></a><br />Follow the instructions in the readme file and then open the spreadsheet included in the zip. This utility can be used to install both custom and standard calculations (those generated by the Calculated Measure Wizard), which makes installing calculations into a cube a quick and simple exercise. However, you do need to understand how the underlying functions are implemented as some of the templates require you to provide inputs such as “offset”, “start”, “stop” and “step”. Now the example worksheet provided does include examples for each of the types of templates, which makes it much easier to understand the values required for some of these templates. Using Excel is a good way to back up all your calculation definitions and makes it very easy to install the calculations into different environments, such as test, training,QA, production etc.<br /><br />To use this utility follow these steps:<br /><br />Step 1: Define your connection<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilDmFX83_lOijDpwkqL0AySV6GpFkADk2WhGR8Yd7M7boJHLrf0dQXq_1jlsYhxIAYnTi2eSihOudLYI1dvasXgzmXEPQ_6vds0eNw_WwX80orQVCB5tMY4hYS4K6nTQBiXTmz2seBHB8/s1600-h/Image6.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilDmFX83_lOijDpwkqL0AySV6GpFkADk2WhGR8Yd7M7boJHLrf0dQXq_1jlsYhxIAYnTi2eSihOudLYI1dvasXgzmXEPQ_6vds0eNw_WwX80orQVCB5tMY4hYS4K6nTQBiXTmz2seBHB8/s400/Image6.JPG" alt="" id="BLOGGER_PHOTO_ID_5174959923057101042" border="0" /></a><br /><br />This should match the details you set in AWM to connect to your analytic workspace.<br /><br />Step 2: Select an AW<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgiYWJANkrPfkBxAQo4F1xF5P9DZojpXkRdTS5-YVeNyD9Dt3K7-LEkhslkSBlfsEzUrQ0-DFYqbjTTEThOfu1ox_4SLh_mtWWqvePOxRfAZ8AkzSEqLBxZ3onBCYuvIPCD_VlcUWIMCA/s1600-h/Image7.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgiYWJANkrPfkBxAQo4F1xF5P9DZojpXkRdTS5-YVeNyD9Dt3K7-LEkhslkSBlfsEzUrQ0-DFYqbjTTEThOfu1ox_4SLh_mtWWqvePOxRfAZ8AkzSEqLBxZ3onBCYuvIPCD_VlcUWIMCA/s400/Image7.JPG" alt="" id="BLOGGER_PHOTO_ID_5174960163575269634" border="0" /></a><br /><br />Once the connection is established the next stage is to select an AW. Each user is not limited to owning and/or using just one AW. In most implementations an OLAP user may have access to multiple AWs. Therefore, it is important to select the required AW before creating any calculations. A pulldown list of available AWs is provided just below the “Connection Details” button.<br /><br />Step 3: Defining the calculation type<br />This utility will allow you to create both custom and pre-defined calculations. The column headed “Calculation Type” can be toggled between two values:<br /><ul><li>Template</li><li>Equation</li></ul><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMDt9dIfofInftztlnWcivAo4JHHJVuhHni3lfzI5GOYmW26FHLqIVk0a1AcnZs6HJ0YunHNsz2YZ354eLWBxk1TqVzdBpWJ_zpOBCNWw86hDJ-86MED-xIdAtOT21tWwEHL2A3Fi64pA/s1600-h/Image8.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMDt9dIfofInftztlnWcivAo4JHHJVuhHni3lfzI5GOYmW26FHLqIVk0a1AcnZs6HJ0YunHNsz2YZ354eLWBxk1TqVzdBpWJ_zpOBCNWw86hDJ-86MED-xIdAtOT21tWwEHL2A3Fi64pA/s400/Image8.JPG" alt="" id="BLOGGER_PHOTO_ID_5174960532942457106" border="0" /></a><br /><br />The “Template” option will install one of the calculations from the AWM Calc Wizard and the “Equation” option allows you to define a free format equation.<br /><br />Step 4: Basic details.<br />Each measure needs to have a name (which is the physical storage name for the measure so it cannot contain spaces or certain characters such as %, $, £ etc.), long label a short label and be assigned to a specific cube.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_fxKDhyKMTcHOcvgalCxkRNCJO1nfUbLLuL2rSo7e1-J19DOjjH6vmg2q4W4FSAIL5hRfCzBRsbYp5_7fOHW-2zmhxEngu9Vh9qPN_zHZU5AxuWB6ve0c3H3v0wTdGC0Xf2ilYcQAhuk/s1600-h/Image9.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_fxKDhyKMTcHOcvgalCxkRNCJO1nfUbLLuL2rSo7e1-J19DOjjH6vmg2q4W4FSAIL5hRfCzBRsbYp5_7fOHW-2zmhxEngu9Vh9qPN_zHZU5AxuWB6ve0c3H3v0wTdGC0Xf2ilYcQAhuk/s400/Image9.JPG" alt="" id="BLOGGER_PHOTO_ID_5174960747690821922" border="0" /></a><br /><br />A pulldown list can be used to select the target cube. The next column to the right allows you to assign the measure to a measure folder.<br /><br />Step 4a: Template Calculations<br />If you are defining a calculation based on a template, a pulldown list of available templates is available in the column marked “Calculation Template”<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1SHqRdtmokbIHHmxYhu7ALs0OqIf_oumj_R0vBf09C759HPngDESE9Xr0_4Jja2_-6z7F7Qor8WJTS9TpcbrnRNEXRYFSpBcK4_4vJCgThlYbkYmxLlSOCbQ0ykZ6l4PK7Bhio1CjIhA/s1600-h/Image10.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1SHqRdtmokbIHHmxYhu7ALs0OqIf_oumj_R0vBf09C759HPngDESE9Xr0_4Jja2_-6z7F7Qor8WJTS9TpcbrnRNEXRYFSpBcK4_4vJCgThlYbkYmxLlSOCbQ0ykZ6l4PK7Bhio1CjIhA/s400/Image10.JPG" alt="" id="BLOGGER_PHOTO_ID_5174960898014677298" border="0" /></a><br /><br />At this point it is a good idea to refer to the sample worksheet as this show you how to complete the additional columns to the right that manage the arguments for the templates:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8fXJFMIcUL4PKDg3mbo1R2o5R4SVAG3NSjV9THGzyEzlPb0MJSPHf7NZ3yu4RLTNd89YJ5XHVhyphenhyphenK7sgZIfwCquGx4D8Ru1xH05pkQ2QDwCruPD7PwvM1sHIv3cZdE2b3W_sI6t0mm3r0/s1600-h/Image11.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8fXJFMIcUL4PKDg3mbo1R2o5R4SVAG3NSjV9THGzyEzlPb0MJSPHf7NZ3yu4RLTNd89YJ5XHVhyphenhyphenK7sgZIfwCquGx4D8Ru1xH05pkQ2QDwCruPD7PwvM1sHIv3cZdE2b3W_sI6t0mm3r0/s400/Image11.JPG" alt="" id="BLOGGER_PHOTO_ID_5174961082698271042" border="0" /></a><br />The inputs are:<br /><ul><li>Base measure – a pulldown list of all available measures is provided</li><li>Dimension – the base dimension, which for most of the templates tends to be Time (pulldown list is available)</li><li>Hierarchy – the main hierarchy from the time dimension (pulldown list is available)</li><li>Level – the target level from the time dimension (pulldown list is available)</li><li>Other numeric arguments determined by the type of template</li></ul><br />All this information is taken from the Calculation Wizard so if you want to check your inputs simply run the calculation wizard in AWM and note the inputs for the specific template.<br /><br />Step 4b: Equation Templates:<br />To create a custom calculation set the calculation type to “Equation” and then in the “Free Form Equation” column enter the formula using either the standard form object names or the physical storage object names. The equations can be one of three basic data types:<br /><ul><li>Decimal</li><li>Integer</li><li>Text</li></ul>In the example below (taken from the sample spreadsheet) two calculated measures are defined, one decimal and one text:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhExgTT8O0Ul3ghw8Pms3sJ1a8W2_0gt4BiawxqQSAnLG4vKJBv6Qz4nAkx2HmSjwOOFwz4Bjr8-ZVILmvBlIfqxghyphenhyphenjBcFNMZ7YLFHxsQAOuDwpb20KF9Jq295kzHiQ9QasKD5lJ_cSIY/s1600-h/Image12.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhExgTT8O0Ul3ghw8Pms3sJ1a8W2_0gt4BiawxqQSAnLG4vKJBv6Qz4nAkx2HmSjwOOFwz4Bjr8-ZVILmvBlIfqxghyphenhyphenjBcFNMZ7YLFHxsQAOuDwpb20KF9Jq295kzHiQ9QasKD5lJ_cSIY/s400/Image12.JPG" alt="" id="BLOGGER_PHOTO_ID_5174961512195000658" border="0" /></a><br /><br />Measure name = <span style="font-size:85%;"><span style="font-family:courier new;">PROFIT</span></span><br />Equation = <span style="font-size:85%;"><span style="font-family:courier new;">SALES.SALES.MEASURE - SALES.COST.MEASURE </span></span><br />Data Type = <span style="font-size:85%;"><span style="font-family:courier new;">DECIMAL</span></span><br /><br />Measure Name = <span style="font-size:85%;"><span style="font-family:courier new;">HOW_IS_MARGIN </span></span><br />Equation = <span style="font-size:85%;"><span style="font-family:courier new;">If SALES.PROFIT.MEASURE/SALES.SALES.MEASURE gt .2 then 'GROOVY' else if SALES.PROFIT.MEASURE/SALES.SALES.MEASURE lt .1 then 'YIPES' else 'WHATEVER'</span></span><br />Data Type = <span style="font-size:85%;"><span style="font-family:courier new;">TEXT</span></span><br /><br />Step 5: Installing the Calculated Measures<br />Once all your calculations are defined, simply on the “Define Calculations” button.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy8K4yFc6CcBURw-kz4nRqok5so3lsXKyq_FVCkNdUX35Pjsvxa6_HqlpncWsHQ_iON9nXhP9LQlv5VvVWi1CzT4lUpDq9r7M9Wqs9LrWuSEtv8cGnWrG11vnoPF1VnpcfwiCif4KxE60/s1600-h/Image13.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy8K4yFc6CcBURw-kz4nRqok5so3lsXKyq_FVCkNdUX35Pjsvxa6_HqlpncWsHQ_iON9nXhP9LQlv5VvVWi1CzT4lUpDq9r7M9Wqs9LrWuSEtv8cGnWrG11vnoPF1VnpcfwiCif4KxE60/s400/Image13.JPG" alt="" id="BLOGGER_PHOTO_ID_5174962366893492578" border="0" /></a><br /><br />This will launch a command window where the OLAP AW XML Java API is used to load the calculated measures defined in the worksheet into the target AW. During the installation process, feedback is written to the command window. An errors will be visible in this window and need to be resolved before trying the installation process again. This utility will overwrite an existing calculated measure so updating an AW is quick and easy since there is no need to first delete any existing calculated measures.<br /><br />Once the measures have been deployed I would recommend starting AWM and checking all the calculated measures were correctly installed and do in fact return data. Sometimes it is easier to do this via the OLAP Worksheet, especially checking the data, since you can limit the various dimensions to a nice small subset of the data.<br /><br />It is possible for a calculated measure to be installed and visible in AWM but not physically present. Which seems a little odd. This usually implies an issue with the naming convention, which allowed the object to be added to the metadata catalog, but the physical name generated an error for some reason. Easiest solution is to delete the calculated measure using AWM and try again after checking the name in the Excel worksheet.Keith Lakerhttp://www.blogger.com/profile/01039869313455611230noreply@blogger.com1tag:blogger.com,1999:blog-3820031471524503731.post-85292902404008954232008-01-24T05:42:00.000-08:002008-12-11T15:25:39.651-08:00OLAP Workshop 6 : Advanced Cube DesignIn the previous workshop we looked at creating a cube making use of AWM’s ability to manage the other features. In most cases these default settings will provide good load and query performance. Certainly when looking at the data model that supports the 10g common schema the default settings do a great job and make life much easier. Consequently, you can design and build the analytic workspace from using the data sourced from the SH schema in about 15 minutes.<br /><br />In some cases you may need to move beyond the default settings and in the next few sections we will look at the other tabs that are part of the Cube wizard. These tabs control sparsity, compression and partitioning features, aggregation rules, and summarization strategies. The tabs and the features they control will be explained in the following order:<br /><ul><li>Implementation Details</li><li>Rules</li><li>Summarize To</li><li>Cache</li></ul><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8i76rrA1eChxDE4AQRlWRChc-SMyk6Dpnh0_iIRplc1tCDauhpMcQ26rVxrnd4KQZKXqUH6_D2a_G0Hu9T1OekuOqlUqQ11tvBrQRZSyL0uNVj_Vdzo1q0AND3D9apbwi1sUNl5hWEPg/s1600-h/Image1.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8i76rrA1eChxDE4AQRlWRChc-SMyk6Dpnh0_iIRplc1tCDauhpMcQ26rVxrnd4KQZKXqUH6_D2a_G0Hu9T1OekuOqlUqQ11tvBrQRZSyL0uNVj_Vdzo1q0AND3D9apbwi1sUNl5hWEPg/s400/Image1.JPG" alt="" id="BLOGGER_PHOTO_ID_5159043973661869346" border="0" /></a><br /><br />But before proceeding there is one important thing you should always do before starting to load data into a cube (of a dimension) – review the data in as much detail as possible. Data quality is a subject that most companies often don’t even consider when building cubes, and most consultants just take the data given to them a load it without question.<br /><br />In any project I would allocate 10-30% of the time looking at the data. The information gained at this stage will provide huge benefits later when you need to determine sparsity patterns (explained later). On a recent customer project I was asked to tune a cube to improve load and aggregation times. When we started to review the data we noticed some very very large numbers in one of the measures, which were simply amazing. After a lot of analysis we determine the ETL that was computing the figure in to the fact table had a mistake. Unfortunately both the developers and business users failed to identify this error. To compound the problem, the data formed a key business metric.<br /><br />Therefore, NEVER EVER start loading data until you have checked the quality. Ideally you should use the data quality features of Warehouse Builder, which can significantly speed up this process. There are a number of presentations relating to data quality on the Warehouse Builder OTN home page.<br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Implementation Details Tab</span><br /></span>Most of the advanced options for tuning your multidimensional model are found on the Implementation Details tabbed page of the Create Cube wizard. As shown below the Implementation Details tabbed page contains four important tuning features of Oracle OLAP. The correct use of these features ensures that your analytic workspace is very efficient and is implemented in an optimal way.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJllmTTl7R2IuvND7SbVnpYaI8xpdtwqICjhWRh4ss7f5L9UjCYFIfPXc_R-oAAJ68Y5rngrWtZdG5Z7wgdLvJZUFs33CWQ3KHBTqr7BgkDvwrr1bDkQPv9L4ubZRMChsI3Kn8O8AXe5s/s1600-h/Image2.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJllmTTl7R2IuvND7SbVnpYaI8xpdtwqICjhWRh4ss7f5L9UjCYFIfPXc_R-oAAJ68Y5rngrWtZdG5Z7wgdLvJZUFs33CWQ3KHBTqr7BgkDvwrr1bDkQPv9L4ubZRMChsI3Kn8O8AXe5s/s400/Image2.JPG" alt="" id="BLOGGER_PHOTO_ID_5159044162640430386" border="0" /></a><br /><br />1.<span style="font-weight: bold;">Sparsity</span>: AWM 10g, by default, applies the common best practice in deciding which of your dimensions should be marked as “sparse” when you create a cube. Sparsity refers to the natural phenomenon evident in all multidimensional data to some degree: Not all the cells in the logical cube (the total possible combinations of all the dimension members for each dimension of the cube) will ever contain data. It is very common for a relatively small percentage of the possible combinations to actually store data. By understanding the sparsity of the data you expect to load into your AW, you can tune how it handles that sparsity and improve the performance of data loading and aggregation and reduce the disk-storage requirements for the populated AW.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8AM3CSv9NCsEZPgmIXQANcs715sspqDHzzpSxWP6rTk0tZ3Tfiros22z9cI3-tN67P9oIBiqG_RaVuF9mSiGx0ZqLRgIPw_DdDcctW8b5c8xX2Lax0U8dLYbnIBIs3TCEeYnJWSefKZo/s1600-h/Image3.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8AM3CSv9NCsEZPgmIXQANcs715sspqDHzzpSxWP6rTk0tZ3Tfiros22z9cI3-tN67P9oIBiqG_RaVuF9mSiGx0ZqLRgIPw_DdDcctW8b5c8xX2Lax0U8dLYbnIBIs3TCEeYnJWSefKZo/s400/Image3.JPG" alt="" id="BLOGGER_PHOTO_ID_5159046580707018114" border="0" /></a><br /><br />After you understand which dimensions are sparse and which are not, their order can be important. When there are a large number of empty cells in a cube, the cube is said to be “sparse.” For example, if you are a manufacturer of consumer-packaged goods, you do not sell one or more of every single product you make to every customer, every day, through every sales channel. Different customers buy different products, at different time intervals, and each customer probably has a preferred channel. Different products may display different sparsity patterns: Ice creams and cold drinks tend to sell faster in the summer, whereas warm arctic coats are more popular in the winter (particularly in cold locations).<br /><br />When using multidimensional technology, pay attention to sparsity so that you can design cubes efficiently. The effect of sparsity in data (and a badly designed cube) can result in tremendous growth in disk usage and a corresponding increase in the time taken to update and recalculate data in the cube. Inefficient sparsity control in any multidimensional data store can result in many empty cells actually being physically stored on the disk. This is something that is less of a concern with relational technology, because it is rare to store a completely null row in a table.<br />Oracle OLAP automatically deals with sparsity up to a point. But you, as a cube builder, can provide Oracle OLAP with the information that you know about your data (and information that Oracle OLAP needs to know) to deal with that data extremely efficiently.<br /><br />Cube designers express sparsity in percentage terms. Data is said to be 5% dense (or 95% sparse) if only 5% of the possible combinations of the cells in a multidimensional measure or cube actually contain data. In many cases, data is very sparse, especially sales and marketing data. Only very aggregated data with a fairly small number of dimensions is typically dense enough for you to not consider sparsity.<br /><br />Sparsity tends to increase with the number of dimensions and with the number of levels and hierarchies in each dimension. As you add dimensions to the definition of a cube, the number of possible cell combinations can increase exponentially. Also, the granularity of data affects sparsity. Low-level, detailed data is much more sparse than aggregate data. Very aggregate data is typically dense. Particular combinations of dimensions typically have different sparsity from others. For example, Time dimensions and Line dimensions are often more dense than dimensions such as Product, Customer, and Channel. This is because combinations of customers and products are sparser than combinations of customers and time or sparser than combinations of products and time. For this reason, AWM 10g asks you to confirm which of the dimensions for your data are sparse dimensions and which ones are dense.<br /><br />In most cases I would recommend making all dimensions sparse. However, there are some additional considerations. The most important is the use of partitioning and we will look at this in one of the following sections. Sometimes, you may need to build a cube with different sparsity settings to determine the most efficient settings. In some cases making Time dense will generate a highly efficient cube and in other situations it will cause the massively extend the time take to load and aggregate data. The best method is to use an iterative development approach, but as with tuning be careful not to change too many settings at once as it becomes difficult to interpret the results.<br /><br />A very common mistake I see with many customers is they insist on loading a zero balance into a measure. This is quite pointless, since a zero balance does not impact the overall total. Now it can be important to differentiate between an NA row and zero-row but for 99.9% of analysis it is possible to infer one from the other. Therefore, when loading data into a cube add an additional filter to remove zero and NA rows since this will provide huge savings in load and aggregation times. I was working on a project recently where a fact table contained 75 million rows of data and 65% of those rows contained 0 or NA.<br /><br />2.<span style="font-weight: bold;">Dimension order</span>: It is possible to improve the build and aggregation performance of your AW by tuning the order in which the dimensions are specified in your cube.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2CDP94uDf5d-BYBj0cuaie69Z5HUTdl6tNeErxItgjcSOdRCvgScv6cOA7j4kZK43vIdmNv0Xd9Rb2eZZxGO1YM8ePVYf6cX9wE60upbFKJrSfc_3PZopPu-Iz30OREBA5c2wbXcDb6g/s1600-h/Image4.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2CDP94uDf5d-BYBj0cuaie69Z5HUTdl6tNeErxItgjcSOdRCvgScv6cOA7j4kZK43vIdmNv0Xd9Rb2eZZxGO1YM8ePVYf6cX9wE60upbFKJrSfc_3PZopPu-Iz30OREBA5c2wbXcDb6g/s400/Image4.JPG" alt="" id="BLOGGER_PHOTO_ID_5159044867015066962" border="0" /></a><br /><br />When using the compression feature (discussed below), it is usually best to have a relatively small, dense dimension (such as Time) first in the list, followed by a group of all the sparse dimensions. Furthermore, it is generally the best practice to list the sparse dimensions in order of their size: from the one with the least members to the one with the most..<br /><br /><span style="font-size:85%;"><span style="font-weight: bold;">Note 1</span>: Sparsity and dimension order are generally considered at the same time, which is why these choices are grouped together in the AWM 10g user interface:<br /></span><br />My recommendation is to try building your cube with Time marked sparse and then try with Time marked dense. The effect on load times varies according to nature of the source data. I recently worked on a project where we marked all the dimensions as sparse and loaded a trial data set in 4 hours. By making Time dense, the same dataset loaded in 1 hour. Therefore, it pays to understand your data. But, most importantly, don’t assume you will get the data model right first time.<br /><br /><br />3.<span style="font-weight: bold;">Compressed cubes and Global Composites</span>: Version 10g of Oracle OLAP provides a new, internationally patented technology for the AW, which is exposed via a simple check box in AWM.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNWLwInQPNMbHWUw_Wdv8eWxSdBxQKAMxXe0MvAP8x2iHqWX-PThszLMo-ZdzNNIJgK-h4o3GZObHGtXROOsXwlmq-3OWEUSQXNTMGkZvuPhCuyJe_jrT-Cnph0nWyaQopd9uBLudlKIw/s1600-h/Image5.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNWLwInQPNMbHWUw_Wdv8eWxSdBxQKAMxXe0MvAP8x2iHqWX-PThszLMo-ZdzNNIJgK-h4o3GZObHGtXROOsXwlmq-3OWEUSQXNTMGkZvuPhCuyJe_jrT-Cnph0nWyaQopd9uBLudlKIw/s400/Image5.JPG" alt="" id="BLOGGER_PHOTO_ID_5159045167662777698" border="0" /></a><br /><br />This is an extremely powerful data storage and aggregation algorithm optimized for sparse data. It is a new technology that is often dramatically faster than any previous OLAP server technology when aggregating sparse multidimensional data. The use of this feature can improve aggregation performance by a factor of 5 to 50. At the same time, query performance can improve, and disk storage is often also dramatically reduced. This feature is ideal for large volumes of sparse data but not suitable for all cubes (especially dense cubes).<br /><br />If the “Use Compression” option is selected, then additional efficiency can often (but not always) be achieved by marking all dimensions (including Time) as sparse, especially for sparse data where there is known seasonality in the data, and especially if your AW is also partitioned on Time. But see my previous notes regarding this subject.<br /><br />As we use this feature on more and more projects it is becoming clear that just about every cube will benefit from compression. Now there are some exceptions, such as cubes where you plan to use and application to write-back data directly into the cube, but such situations are easily managed by posting the updated data to a relational table and using the normal data load procedures to import and aggregate the data.<br /><br />Note: Dimension order is unimportant when using compression. The multidimensional engine automatically determines how best to physically order the data after it is loaded.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg09-ZVyN1RtYDJbFv1fv0BmzTszrM69iYrnw8D05taWpuXPm3HmWWj9IZ2Fu8lRxEMT5p9o4Ujk3E3mqUNXYnVrd6yJDh0SZwSyMjHgEStXaZE85bJcffchojSOpsWGPK6_LXpLbzU9Cw/s1600-h/Image6.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg09-ZVyN1RtYDJbFv1fv0BmzTszrM69iYrnw8D05taWpuXPm3HmWWj9IZ2Fu8lRxEMT5p9o4Ujk3E3mqUNXYnVrd6yJDh0SZwSyMjHgEStXaZE85bJcffchojSOpsWGPK6_LXpLbzU9Cw/s400/Image6.JPG" alt="" id="BLOGGER_PHOTO_ID_5159046791160415634" border="0" /></a><br /><br />A composite is an analytic workspace object used to manage sparsity. It maintains a list of all the sparse dimension-value combinations for, which there is data. By ignoring the sparse “empty” combinations in the underlying physical storage, the composite reduces the disk space required for sparse data. When data is added to a measure dimensioned by a composite, the AW automatically maintains the composite with any new values.<br /><br />A “global” composite is simply a single composite for all data in a cube. Depending on the Compression and Partitioning choices you make, the behaviour of AWM will vary.<br /><br />When would you opt to create Global Composites? The answer is very rarely. It can be beneficial to select this option in the case of a non-compressed cube that is partitioned. But as stated above, it is probably best to use compression on just about every cube you create, so you should probably leave the option unselected.<br /><br /><br />4.<span style="font-weight: bold;">Partitioned cubes</span>: You can partition your cube along any level in any hierarchy for a dimension. This is another way of improving the build and aggregation performance of your AW, especially if your computer has multiple CPUs. Oracle Database 10g (and thus the OLAP option) can run on single-CPU computers, large multi-CPU computers, and (with Real Application Clusters and Grid technology) clusters of computers that can be harnessed together and used as if they are one large computer. Oracle OLAP is, therefore, perhaps the most scalable OLAP server available.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzRpp9bJfFdTUQfkQbugTGkPAw9pFBLtb3RYrINA7-VEfjNgtE0g0nMkqcEkw3GXyDqP4ouQi1DGnhq3bx4VTymsSmwLERJ3WHtFbYI9uB1M5zDf2btkDcu7tcanpmSwSiHMOO0yncrRk/s1600-h/Image7.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzRpp9bJfFdTUQfkQbugTGkPAw9pFBLtb3RYrINA7-VEfjNgtE0g0nMkqcEkw3GXyDqP4ouQi1DGnhq3bx4VTymsSmwLERJ3WHtFbYI9uB1M5zDf2btkDcu7tcanpmSwSiHMOO0yncrRk/s400/Image7.JPG" alt="" id="BLOGGER_PHOTO_ID_5159047035973551522" border="0" /></a><br /><br />Using partitioning does have certain knock-on consequences in 10g, but these are resolved in11g. In 10g, when you look at the “Summarize To” tab (this will be explained later) the levels above the partition key cannot be pre-aggregated and have to be solved at query time. Therefore, it is critical to select an appropriate level as the partition key so that query performance is maintained. Let us consider the example of time dimension:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPcm5XnO8R49kXp4BC36j8BSC8V4qzBygtgnplqNyy0J-T1jJxgrkS44uLi6r0GfhFDbOjiclsGeQoGzkOxzEsEB__7WWXszLube8TLFk5ZFwwl5-A420SuUWWTEGrqPi7qMkriuPmNDM/s1600-h/Image8.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPcm5XnO8R49kXp4BC36j8BSC8V4qzBygtgnplqNyy0J-T1jJxgrkS44uLi6r0GfhFDbOjiclsGeQoGzkOxzEsEB__7WWXszLube8TLFk5ZFwwl5-A420SuUWWTEGrqPi7qMkriuPmNDM/s400/Image8.JPG" alt="" id="BLOGGER_PHOTO_ID_5159047216362177970" border="0" /></a><br /><br />If we use Day as the partition key, each individual partition will be small which should improve load times and aggregation times. But when a user creates a query based on yearly data 365 values have to be aggregated at run time for each cell being referenced within the query. Depending on the hardware this might or might not provide acceptable query performance.<br /><br />If we use month as the partition key, each individual partition will still be relatively small and load times and aggregation times should still be acceptable. Each partition will hold between 28-31 days worth of data and in this case it would be prudent to make Time sparse within the model. However, when a user creates a query based on yearly data only 12 values have to be aggregated at run time for each cell being referenced within the query.<br /><br />Partitioning has a big impact on two key areas:<br /><ul><li>Partial Aggregation</li><li>Parallel Processing</li></ul>Partial Aggregation – the Oracle OLAP option supports incremental updates to a cube (as we will see in a later workshop). This allows the engine to only aggregate date for just those members where data has been loaded. Which means the aggregation process can work with a substantially reduced set of data. For example, if we are loading data for Dec 2008, then for the time dimension only the members Q4 2008 and 2008 are impacted by any data loaded.<br /><br />Parallel Processing – By partitioning a cube, it is possible to solve it in parallel assuming data is being loaded into more than one partition. Which brings us to an important point. Most customers will typically partition their cubes by time. Of course if you only load data for one month at a time and use month as the partition key then parallel processing is not going to occur. Which may or may not be a good thing.<br /><br /><span style="font-weight: bold;font-size:130%;">Rules Tab</span><br />On the Rules tabbed page, you identify aggregation rules for the cube (this is also available within each individual measure). You have many different kinds of aggregations available. This is one of the most powerful features of Oracle OLAP, enabling different dimensions to be independently calculated using different aggregation methods (or not using aggregation at all). In effect, a different aggregation method can be applied each dimension within a cube. The engine itself is also capable of supporting dimension member level aggregation plans through the use of MODELS. However, at this point in time Analytic Workspace Manager 10g does not support this feature. But AWM11g will support the ability to create dimension member aggregation plans in the form of custom aggregates.<br /><br />In this image below, the aggregation method of SUM is used across all dimensions.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPWBBd1gS2b_a_UjX5TqvvN-LAo75mJrQOuCkK39tKTvuy6IRr2hqGX0EkcAx4NO9Tve-Kfc4im9SYmcDV7ItocSeuoP3WYKQbT5m-2XvxBgcTZ8IsmMzBBO4Suf4ZYiTJuS-OoKP1UlM/s1600-h/Image9.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPWBBd1gS2b_a_UjX5TqvvN-LAo75mJrQOuCkK39tKTvuy6IRr2hqGX0EkcAx4NO9Tve-Kfc4im9SYmcDV7ItocSeuoP3WYKQbT5m-2XvxBgcTZ8IsmMzBBO4Suf4ZYiTJuS-OoKP1UlM/s400/Image9.JPG" alt="" id="BLOGGER_PHOTO_ID_5159047443995444674" border="0" /></a><br /><br />However, as we will see later different aggregation methods are available. For example, if you have costs and price data, you may want to see this data averaged over time, answering such business questions as “What is the average cost over 12 months?” or “What is the average price over 2 years?”<br /><br /><span style="font-weight: bold;font-size:85%;">Aggregation Methods</span><br />It is common to set the aggregation rules only once for all measures contained in a cube. When you define a cube, you identify an aggregation method and any measures that you create that belong to the cube automatically receive the aggregation methods for that cube. This is the default behaviour, and it is one of the benefits of using a cube: By setting up aggregation rules and sparsity handling for all the measures once at the “cube” level, you save time and reduce the scope for errors or inconsistencies.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkBSXnCJD8E-wJC8QKZFVMNlLlXrfFbfDtB1cZCfgsuvoWCzvn7y391ewxb50dZ8v1mLdKnsaYtiB7Jfid4xIwuMrsBoSi-TrLTcAu-J_6133ZC28ASOjFZg-FedVcSwldxGxMnweiLUk/s1600-h/Image11.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkBSXnCJD8E-wJC8QKZFVMNlLlXrfFbfDtB1cZCfgsuvoWCzvn7y391ewxb50dZ8v1mLdKnsaYtiB7Jfid4xIwuMrsBoSi-TrLTcAu-J_6133ZC28ASOjFZg-FedVcSwldxGxMnweiLUk/s400/Image11.JPG" alt="" id="BLOGGER_PHOTO_ID_5159048028110996962" border="0" /></a><br /><br />The default for aggregation used by AWM is the SUM method (simple additive aggregation) for each dimension. However, you do not have to aggregate data. Some measures have no meaning at aggregate levels of certain dimensions. In such cases, you can specify that the data is non-additive and should not be aggregated over those dimensions at all. Choosing the non-additive aggregation method means that when you view the data in the analytic workspace, you find data only at the leaf levels of the dimensions for which you selected that method.<br />Understanding Aggregation<br /><br />AWM allows you to set aggregation rules for each dimension independently for your cubes and measures. That is, each dimension, if required, can use a different mathematical method of generating data for the parent and ancestors.<br /><br />Here are some examples of different aggregation methods:<br /><ul><li>SUM simply adds up the values of the measure for each child value to compute the value for the parent. This is the default (and most common) behaviour.</li><li>AVERAGE calculates the average of the values of the measure for each child value to provide the value for the parent.</li><li>LAST takes the last non-NA (Null) value of the child members and uses that as the value for the parent.</li></ul><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLTLw-bx6GJ8xp_iWIaDOu7lHocYv7z-R16T4aVktyrnGMCg5ym6_8hzlQqkrj3JwSYGZ4U8xS5DwQ5muNPsSeMIbgAgzgehaCzspAvSsPoYsdhqOaschNkXNFpA3RK4u5q0KRMUe5Kds/s1600-h/Image10.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLTLw-bx6GJ8xp_iWIaDOu7lHocYv7z-R16T4aVktyrnGMCg5ym6_8hzlQqkrj3JwSYGZ4U8xS5DwQ5muNPsSeMIbgAgzgehaCzspAvSsPoYsdhqOaschNkXNFpA3RK4u5q0KRMUe5Kds/s400/Image10.JPG" alt="" id="BLOGGER_PHOTO_ID_5159050042450658898" border="0" /></a><br /><br />Sales quantities and revenues are usually aggregated over all dimensions using the SUM method, whereas inventory or headcount measures commonly require a different method (such as LAST) on the Time dimension and SUM for the other dimensions. More advanced aggregation methods, such as weighted average, are useful when aggregating measures such as Prices (weighted by Sales revenue).<br /><br /><span style="font-weight: bold;font-size:85%;">Different Aggregation for Individual Measures</span><br />However, you are not limited to specifying that all measures of a cube have the same aggregation method. When adding measures to the cube, you can specify a different aggregation method, and accept the defaults of all the other measure settings.<br /><br />For example, it is not uncommon for a single cube to contain measures such as Sales Revenue, Sales Quantity, Order Quantity, and Stock/Inventory Quantity. All these measures will aggregate using the SUM method over all dimensions, except for the Stock/Inventory measure. This requires a LAST method on the Time dimension (and SUM on all the others). Using the Rules tab for the Stock measure you can override the default aggregation method for Time and set the method to LAST, while retaining all the all other default settings from the cube.<br /><br /><span style="font-size:85%;">Note: The ability to override cube settings for individual measures is not supported in compressed-cubes. If you use compression, and one of your measures requires a different aggregation method, you need to create it in a separate cube.</span><br /><br /><span style="font-weight: bold;font-size:85%;">Aggregation Operators</span><br />There are a number of different aggregation operators available to you for summarizing data in your AW. The following is a brief description of each of the operators.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5fjBRgQGrbB0srYDM_wjVwJuGOS16GIyIuve1n6TG7UoSSd_MMVuQ89JAFHJX6YJCIfQOxh2Gn_7qKaYkVc2bJMfo66Vt_DC1HBBjV7009JMxPbf-46XaJLoeJma5jqTarS0bu_DybVI/s1600-h/Image12.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5fjBRgQGrbB0srYDM_wjVwJuGOS16GIyIuve1n6TG7UoSSd_MMVuQ89JAFHJX6YJCIfQOxh2Gn_7qKaYkVc2bJMfo66Vt_DC1HBBjV7009JMxPbf-46XaJLoeJma5jqTarS0bu_DybVI/s400/Image12.JPG" alt="" id="BLOGGER_PHOTO_ID_5159048363118446066" border="0" /></a><br /><br /><ul><li><span style="font-weight: bold;">Average</span>: Adds data values, and then divides the sum by the number of data values that are added together</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Hierarchical Average</span></span>: Adds data values, and then divides the sum by the number of children in the dimension hierarchy. Unlike Average, which counts only non-NA children, Hierarchical Average counts all the logical children of a parent, regardless of whether each child does or does not have a value.</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Hierarchical Weighted Average</span></span>: Multiplies non-NA child data values by their corresponding weight values, and then divides the result by the sum of the weight values. Unlike Weighted Average, Hierarchical Weighted Average includes weight values in the denominator sum even when the corresponding child values are NA. You identify the weight object in the Based On field.</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Weighted Average</span></span>: Multiplies each data value by a weight factor, adds the data values, and then divides that result by the sum of the weight factors. You identify the weight object in the Based On field.</li><li><span style="font-size:85%;"><span style="font-weight: bold;">F</span></span><span style="font-size:85%;"><span style="font-weight: bold;">irst Non-NA Data Value</span></span>: The first real data value</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Hierarchical First Member</span></span>: The first data value in the hierarchy, even when that value is NA</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Hierarchical Weighted First</span></span>: The first data value in the hierarchy multiplied by its corresponding weight value, even when that value is NA. You identify the weight object in the Based On field.</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Weighted First</span></span>: The first non-NA data value multiplied by its corresponding weight value. You identify the weight object in the Based On field.</li><li><span style="font-weight: bold;font-size:85%;">Last Non-NA Data Value</span>: The last real data value</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Hierarchical Last Membe</span></span>r: The last data value in the hierarchy, even when that value is NA</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Hierarchical Weighted Last</span></span>: The last data value in the hierarchy multiplied by its corresponding weight value, even when that value is NA. You identify the weight object in the Based On field.</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Weighted Last</span></span>: The last non-NA data value multiplied by its corresponding weight value. You identify the weight object in the Based On field.</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Maximum</span></span>: The largest data value among the children of each parent</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Minimum</span></span>: The smallest data value among the children of each parent</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Non-additive (Do Not Summarize)</span></span>: Do not aggregate any data for this dimension. Use this keyword only in an operator variable. It has no effect otherwise.</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Sum</span></span>: Adds data values (default)</li><li><span style="font-weight: bold;font-size:85%;">Scaled Sum</span>: Adds the value of a weight object to each data value, and then adds the data values. You identify the weight object in the Based On field.</li><li><span style="font-size:85%;"><span style="font-weight: bold;">Weighted Sum</span></span>: Multiplies each data value by a weight factor, and then adds the data values. You identify the weight object in the Based On field.</li></ul><span style="font-size:85%;"><span style="font-weight: bold;">Aggregating Across Multiple Hierarchies</span></span><br />Most dimensions within real world models will have multiple hierarchies. In the image below, there are two separate hierarchies on the Time dimension.<br /><br />On the Aggregation Rules tabbed page, when creating a cube, you can specify which hierarchy or hierarchies should be used for aggregation for that cube’s measures. You should select one or more hierarchies for each dimension being aggregated. If you omit a hierarchy, then no aggregate values are stored in it; they are always calculated in response to a query.<br /><br />Because this may reduce query performance, generally you should omit a hierarchy only if it is seldom used. The default behaviour of AWM 10g is to select all hierarchies.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlgJl2FIUy2wCnpLpNsegui9hhmKOsrgDT59QtLxxxqyxwIG0x-tiEaRmIUkvO3sp5YlHRmffFj-eKMD3dV7qQbWBfJf4Pb8H-pbl7Tlw6SOuVJnefLrx9fKGpRxHTVhRmrsn9rf2Pgp8/s1600-h/Image14.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlgJl2FIUy2wCnpLpNsegui9hhmKOsrgDT59QtLxxxqyxwIG0x-tiEaRmIUkvO3sp5YlHRmffFj-eKMD3dV7qQbWBfJf4Pb8H-pbl7Tlw6SOuVJnefLrx9fKGpRxHTVhRmrsn9rf2Pgp8/s400/Image14.JPG" alt="" id="BLOGGER_PHOTO_ID_5159048646586287618" border="0" /></a><br /><br /><span style="font-size:85%;"><span style="font-weight: bold;">Aggregating Measures with Data Coming in at Different Levels</span></span><br />There are other occasions where careful selection of the hierarchies to use in aggregation is important, especially for measure data that arrives into the AW at different levels of aggregation.<br /><br />Suppose you have an AW that contains Budget and Actuals cubes for the purposes of variance analysis. The leaf level for Actuals is the Day level, but Budgets are set at the Monthly level. Initially, you created a single Time hierarchy in which Year is the highest level and Day is the lowest level:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXkisHatRw1lRUK46KSU2JASSxXYG8ijy50t7WR5gasuEmDM3cNz3A6zjAlgudmEqQ3M-fgyU0z_S9o-Qmg8pscCeX-ZuSyqCS2SJFFlCA4Pj8LUIqJLkPpgLugJuX0FZQppGL-kaFWww/s1600-h/Image8.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXkisHatRw1lRUK46KSU2JASSxXYG8ijy50t7WR5gasuEmDM3cNz3A6zjAlgudmEqQ3M-fgyU0z_S9o-Qmg8pscCeX-ZuSyqCS2SJFFlCA4Pj8LUIqJLkPpgLugJuX0FZQppGL-kaFWww/s400/Image8.JPG" alt="" id="BLOGGER_PHOTO_ID_5159048955823932962" border="0" /></a><br /><br />This is perfect for the aggregation hierarchy for the Actuals measures. However, there is an issue with the Budgets measure. If data is loaded at the Month level, but this hierarchy is used for the aggregation of Budgets, then aggregation may begin at the Day level. All the empty cells for Budget at the Day level would be interpreted as zeros for the purposes of aggregating the data, resulting in new monthly totals being calculated as zero.<br /><br />To handle this situation, a recommended approach is to create a second hierarchy that stops at the Month level specifically for the purposes of aggregating Budgets:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsjwEe9IwKpBhUmaxuAsrnQF409yAG8_E4ch87Lt541cJcewkpqXM4LTs5kFw41Hj0X3kQiCrW9sb9Uo4_q8a7NTA0YUIrdmNNQCLhyphenhyphenD-G1mUPz6ux1sokQUfOEhn8lxIfwI7PHUzGhQ4/s1600-h/Image15.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsjwEe9IwKpBhUmaxuAsrnQF409yAG8_E4ch87Lt541cJcewkpqXM4LTs5kFw41Hj0X3kQiCrW9sb9Uo4_q8a7NTA0YUIrdmNNQCLhyphenhyphenD-G1mUPz6ux1sokQUfOEhn8lxIfwI7PHUzGhQ4/s400/Image15.JPG" alt="" id="BLOGGER_PHOTO_ID_5159048878514521618" border="0" /></a><br /><br />You must deselect the hierarchy containing the Day level on the Aggregation Rules tab for the cube or measure in question. Use the Day-level hierarchy for the Actuals measures only. The Day-level hierarchy is the primary or default hierarchy for end users because it enables drilling down to the Day level, and Budgets are available at Month, Quarter, and Year, exactly as required.<br /><br /><br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Summarize To Tab</span><br /></span>Within all OLAP models you will need to balance the desire to aggregate absolutely everything and the time taken to load into a cube and then aggregate that data. In general, the less you choose to pre-summarize when loading data into the AW, the higher the load placed on run-time queries. In this scenario, queries are likely to be a bit slower and the load on the server at query time is likely to be greater (for example, each user query is likely to be asking the server to do more calculations at a given point in time). Pre-calculated summaries are instantly available for retrieval and are generally faster to query.<br /><br />However, it does not necessarily follow that full aggregation across all levels of all dimensions yields the best query performance. In many cases, partial summarization strategies can provide optimal build and aggregation performance with little noticeable impact on query performance.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF4e5nXzMKTKCb9V_Gg_Orjc0Tyauierek9d4wvDYY1XmdXU6EVWxgok_lEn7qkFZrtPtzZ-OXnm6nv_mRhZduQHbj99uwHwEbYCMzWoRRRt9Gwlg3AbS9LH1ljmo-M7wyKnMmWPJmr_w/s1600-h/Image13.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF4e5nXzMKTKCb9V_Gg_Orjc0Tyauierek9d4wvDYY1XmdXU6EVWxgok_lEn7qkFZrtPtzZ-OXnm6nv_mRhZduQHbj99uwHwEbYCMzWoRRRt9Gwlg3AbS9LH1ljmo-M7wyKnMmWPJmr_w/s400/Image13.JPG" alt="" id="BLOGGER_PHOTO_ID_5159049265061578290" border="0" /></a><br /><br />Many experienced OLAP cube builders make the following recommendations regarding summarization strategies:<lu><br /></lu><ul><li><lu></lu><br /></li><li>Large dimensions, and those with many deep levels and/or hierarchies, are typically the most “expensive” to aggregate over. They are also likely to be one of the sparse dimensions in the cube definition. For such dimensions, a common guideline is to decide to summarize using a “skip-level” approach—that is, to precalculate every other level in the hierarchy. This generally gives reasonably good results and a solid basis for further tuning (if required)</li><li>If there is a small, dense dimension (such as Time) as the first dimension on the list of dimensions for a cube, then it is often a good strategy to leave that dimension to completely summarize on the fly at run time, especially if a large number of sparse data-level combinations have been computed</li></ul>AWM generally defaults to settings that reflect this advice, but you can tune the settings if you need to. But at least the defaults provide a good starting point for tuning a build if required. But be warned, adding more levels to be pre-summarized will require additional storage space.<br /><br />When you build and test your AWs, it is a good idea to include time in your project plan to experiment with different summarization strategies. Estimating in advance the exact storage requirements and aggregation times of a multidimensional cube (especially a highly dimensional, sparse one) is extremely difficult. So, it is often the case that some tuning after data is properly understood improves the performance of builds and aggregations.<br /><br />You can use a database package to help you plan your summarisation strategy. There are two procedures, part of the DBMS_AW package that can provide help and guidance:<br /><ul><li>The SPARSITY_ADVICE_TABLE procedure creates a table for storing the advice generated by the ADVISE_SPARSITY procedure</li><li>The ADVISE_SPARSITY procedure runs a series of queries against your data and make recommendations about what data to pre-summarize and what to leave for dynamic aggregation. The 11g release of Analytic Workspace Manager leverages this database feature and make recommendations directly inside the tool<br /></li></ul><lu><br /></lu><br /><br /><br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Cache Tab</span></span><br />Caching improves run-time performance in sessions that repeatedly access the same data, which is typical in data analysis. Caching temporarily saves calculated values in a session so that you can access them repeatedly without recalculating them each time. You have two options:<br /><ul><li>Cache run-time aggregations using session cache: This is the default behaviour. This option ensures that any run-time aggregations that are completed during a session are cached for the remainder of the session, improving query performance as the session progresses. This setting is ideal for a larger number of OLAP applications, namely those that allow read-only analysis where the underlying data is not changing during a session. </li><li>Do not cache run-time aggregations: Select this option if the cube would be subject to what-if analysis and, therefore, it would be important that previously calculated summarizations are not reused.</li></ul><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOtFebwR9Rn-fllxILhr5PI5yWeYkkd0UkEaF3FxCAUZo_HA39CZ_SGYKQKKnZx-F276nbqMxBTPW1zo8SNZnqXdBAGVbpuWFzqa3r6R8m0KxCaCzSPA-_OzbaJGf25Xi0YrluY6aMjXw/s1600-h/Image16.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOtFebwR9Rn-fllxILhr5PI5yWeYkkd0UkEaF3FxCAUZo_HA39CZ_SGYKQKKnZx-F276nbqMxBTPW1zo8SNZnqXdBAGVbpuWFzqa3r6R8m0KxCaCzSPA-_OzbaJGf25Xi0YrluY6aMjXw/s400/Image16.JPG" alt="" id="BLOGGER_PHOTO_ID_5159049522759616066" border="0" /></a><br />In the next workshop we will review how to quickly and easily load data into a cube and then review some best practices for loading data within a production environment.Keith Lakerhttp://www.blogger.com/profile/01039869313455611230noreply@blogger.com0tag:blogger.com,1999:blog-3820031471524503731.post-77310489395376042342008-01-21T03:19:00.000-08:002008-12-11T15:25:43.549-08:00OLAP Workshop 5 : Building CubesIn the last series of Workshops, we started to look at building the dimensions to support our data model. Each dimension contained levels and a hierarchy. The purpose of a hierarchy is to provide the relationships for summarization of measures in the cube and to make navigating multiple levels of data easy and intuitive for the end user. The next stage is to start building cubes.<br /><br /><span style="font-size:130%;">Creating Cubes<br /></span><span style="font-weight: bold;"><br />What Are Cubes?</span><br />Cubes are containers of measures (facts). They simply provide a convenient way of collecting up measures with the same dimensions. Therefore, all measures in a cube are candidates for being processed together at all stages: data loading, aggregation, and storage. Cubes are only visible to the cube builder (end users only see the measures they contain) and simplify the setup and maintenance of measures in AWM.<br /><br /><span style="font-weight: bold;">Creating Cubes</span><br />To create a cube, right-click the Cubes node in the navigator, and then select the Create Cube option.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMupeE18xa2OxsNDvI3uge3fxEZaOhzfr5NI33vHVYK0Pg6VClrt1PA7a1emkBr5CclQtDUkI3yqu-_UnEogwFlmAC0Q15Dsvo35RYXUMl04RsPj44SB2nh4c7GCTOt0zrpS8xfZqN17M/s1600-h/image2.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMupeE18xa2OxsNDvI3uge3fxEZaOhzfr5NI33vHVYK0Pg6VClrt1PA7a1emkBr5CclQtDUkI3yqu-_UnEogwFlmAC0Q15Dsvo35RYXUMl04RsPj44SB2nh4c7GCTOt0zrpS8xfZqN17M/s400/image2.JPG" alt="" id="BLOGGER_PHOTO_ID_5157888807543877298" border="0" /></a><br /><br /><span style="font-weight: bold;">Note:</span> You can also create a cube from a cube template if you have a template available.<br /><br />The Create Cube window appears, as shown below:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKtuP6qyHLsVcZHDbt8arfIWCj6HTMrAIQkLRT-KFUQQU5Uml1ijWrn-X3uYV4irl5mOQFPc10QUCh0vbQgClS7487TAoIC1IBwAf_H6Olb5m4H2rBTwL7x8vHjnq-FE3I_FJi_F-7RBM/s1600-h/image3.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKtuP6qyHLsVcZHDbt8arfIWCj6HTMrAIQkLRT-KFUQQU5Uml1ijWrn-X3uYV4irl5mOQFPc10QUCh0vbQgClS7487TAoIC1IBwAf_H6Olb5m4H2rBTwL7x8vHjnq-FE3I_FJi_F-7RBM/s400/image3.JPG" alt="" id="BLOGGER_PHOTO_ID_5157890160458575554" border="0" /></a><br /><br />The Create Cube wizard provides a tabbed page interface that enables you to specify the logical model and processing options for a cube. The best way to use this wizard is to always work from left to right across the various tabs.<br /><br /><span style="font-style: italic;">General Tabbed Page</span><br />On the General tabbed page, enter the basic information about the cube:<br /><ul><li>Provide the cube with a distinct name and provide the short and long label descriptions. Note – the name of the cube cannot be changed once the cube has been created.</li><li>Identify the dimensionality of the cube by using the arrow keys to move dimensions from the Available Dimension list to the Selected Dimension list. After you define the dimensionality, all measures that you create based on this cube will have the same dimensionality. Note – the dimensionality of the cube cannot be changed once the cube has been created.</li></ul>Remember that Oracle OLAP supports cubes of different dimensionality. Therefore, you do not need to select all the dimensions listed in the panel marked ‘Available Dimension’.<br /><br />The tick box “Use Default Aggregation Plan for Cube Aggregation” allows you to shortcut the process of creating of measures by applying the settings defined at the cube level to all measures within the cube. As we will see later, defining measures is an almost identical process as defining cube.<br /><br /><span style="font-style: italic;">Translations Tabbed Page </span><br />Enables you to provide long and short descriptions for the cube in each language that the AW supports. Although there are other tabs within the cube wizard, at this point it is possible to ignore all the other tabs and allow the AWM to default all the other features.<br /><br /><span style="font-weight: bold;">Adding Measures to a Cube</span><br />Base measures store the facts collected about your business. Dimensions logically organize the edges of a measure, and the body of the measure contains data values. Each measure belongs to a particular cube, and by default all the settings for a measure (such as dimensions) are inherited from the cube.<br /><br />Right clicking on the Measures node in the navigator can create a measure. Next select the Create Measure option.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4zwPALm_V4osfxDftPAiHTWCj20iYcCABow9EcRZ8L_AGVAjOzHo8MwIOowepL8u_OsQUNRoGav9yqKlANuErjSBO9tQvwJTYeBfbJj-hr5fFMaiaOQUiiYJJJs6E5cOc83vEtUrz-Zo/s1600-h/image4.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4zwPALm_V4osfxDftPAiHTWCj20iYcCABow9EcRZ8L_AGVAjOzHo8MwIOowepL8u_OsQUNRoGav9yqKlANuErjSBO9tQvwJTYeBfbJj-hr5fFMaiaOQUiiYJJJs6E5cOc83vEtUrz-Zo/s400/image4.JPG" alt="" id="BLOGGER_PHOTO_ID_5157890448221384402" border="0" /></a><br /><br />This will then launch the wizard to create the measure:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpxilGhdeqpST2pAZukxSMbmy2QZLKNA-ZuoG8fUJ4CbgWpyWsXpFn5-FToaa4Y9obBqxw7vZ-udO63ATsFZkUm58cWaRhOGY9O_ZxDDn-Dg4divcvW49ZSQQCvrppe6k_YOzB-m2joJI/s1600-h/image5.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpxilGhdeqpST2pAZukxSMbmy2QZLKNA-ZuoG8fUJ4CbgWpyWsXpFn5-FToaa4Y9obBqxw7vZ-udO63ATsFZkUm58cWaRhOGY9O_ZxDDn-Dg4divcvW49ZSQQCvrppe6k_YOzB-m2joJI/s400/image5.JPG" alt="" id="BLOGGER_PHOTO_ID_5157890585660337890" border="0" /></a><br /><br /><br /><span style="font-style: italic;">General Tabbed Page</span><br />On the General tabbed page, you create a name and add label information. Long labels are used by most OLAP clients for display. If you do not specify a value for the long label, then it defaults to the measure’s name. Once the measure is defined you cannot change the name of the measure. If you delete a measure all the data associated with that measure is lost.<br /><br /><span style="font-style: italic;">Other Tabbed Pages</span><br />The Translations tabbed page enables you to provide long and short descriptions for the measure in each language that the AW supports. The other tabbed pages (Implementation Details, Rules, and so on) enable the selection of certain measure-specific processing options other than the settings that are applied by the definition of the cube. These tabbed pages are examined in the following workshop.<br /><br />At this point it possible to simply create the measure and allow AWM to default all the other settings.<br /><br /><span style="font-weight: bold;">Loading Data into a Cube.</span><br />After creating logical objects, you can map them to relational data sources in the Oracle database. Afterward, you can load data into your analytic workspace by using the Maintain Analytic Workspace Wizard.<br /><br /><span style="font-style: italic;">Step 1 – Mapping Data Sources</span><br />To map your measures to a data source, perform these steps:<br /><br />1. In the navigator, choose Mappings for the cube that contains the measure that you want to map. A list of schemas appears. Find the schema to which you want to map your measure, and then click the + button.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie3zaylmIt16giC-E-CA0r4VsLxCAlEXXXC_ihiZsLu9o3hTgDcY44KpEG7-FTVCEEIJEBXww7eGrTNtGAILV6Y_kBApa_cg86dxluAx-TSQLzKy6hMWClCSoyhqUk-SdWU_bgIAspkE0/s1600-h/image6.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie3zaylmIt16giC-E-CA0r4VsLxCAlEXXXC_ihiZsLu9o3hTgDcY44KpEG7-FTVCEEIJEBXww7eGrTNtGAILV6Y_kBApa_cg86dxluAx-TSQLzKy6hMWClCSoyhqUk-SdWU_bgIAspkE0/s400/image6.JPG" alt="" id="BLOGGER_PHOTO_ID_5157890796113735410" border="0" /></a><br /><br />2. Select either Tables or Views, depending on what you are mapping to.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlGyVrRr6l-PqEGWsAi3jSxcJtcr_VEXZW0hZuPitFTdVr5g2sGBIzwDVsk9O1YIlQJmjX5KKJEf8fDf5B1Vb6bQ6rSkzg3yRdqFEPR_Qti30h8RXCiOayha4J_iAmVJ6yjqWWHOTSws0/s1600-h/image7.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlGyVrRr6l-PqEGWsAi3jSxcJtcr_VEXZW0hZuPitFTdVr5g2sGBIzwDVsk9O1YIlQJmjX5KKJEf8fDf5B1Vb6bQ6rSkzg3yRdqFEPR_Qti30h8RXCiOayha4J_iAmVJ6yjqWWHOTSws0/s400/image7.JPG" alt="" id="BLOGGER_PHOTO_ID_5157891332984647458" border="0" /></a><br /><br />3. Find the table or view name and double-click, or drag it to the mapping canvas. When on the canvas, the structure of the table is visible.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3_xfF7PJh_GlPwB-0ye26hurSRCmKUhwWzZ3BWRPmOgxS3hATNNwGsZW972yP4XrJXlYgk9bbfQl1FE-Na5-cGLNg3ayz_6XHQsOxqRxbBunv7d1ZOsQuQtawYAITdJ24qi_X6_j3xGM/s1600-h/image8.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3_xfF7PJh_GlPwB-0ye26hurSRCmKUhwWzZ3BWRPmOgxS3hATNNwGsZW972yP4XrJXlYgk9bbfQl1FE-Na5-cGLNg3ayz_6XHQsOxqRxbBunv7d1ZOsQuQtawYAITdJ24qi_X6_j3xGM/s400/image8.JPG" alt="" id="BLOGGER_PHOTO_ID_5157891152596021010" border="0" /></a><br /><br /><br /><span style="font-weight: bold;">Note:</span> If you want to see the data in the table or view, right-click the name of the table or view, and then select the View Data option.<br /><br />My recommendation is never to map directly to a fact table. Always use a view as this allows to you to fine tune the load process. For example by using a view you can select to load a single time period, which can be useful when you are trying to manage some of the more advanced settings and you are using an iterative development approach. As you will see later, using a view can make the data take stage (i.e. the initial build of the cube) easier to plan and manage.<br /><br /><br />4. Drag the cursor from the column name in the relational source to the destination object name in the measure. The image below shows a completed mapping.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_hqEzzw1KdcN9XOvupDSlSRqFy1NQ1dm-Vnh_Z4NqppTWeJTF3fH1pgdEib65n-vmC4-UYb2N8FAt2iM7yMDZNMukWyRSGETVzCVPkQNH_3oFpdAyyJG1yv4v8OphsDW93YOSmlcBGC0/s1600-h/image9.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_hqEzzw1KdcN9XOvupDSlSRqFy1NQ1dm-Vnh_Z4NqppTWeJTF3fH1pgdEib65n-vmC4-UYb2N8FAt2iM7yMDZNMukWyRSGETVzCVPkQNH_3oFpdAyyJG1yv4v8OphsDW93YOSmlcBGC0/s400/image9.JPG" alt="" id="BLOGGER_PHOTO_ID_5157891040926871298" border="0" /></a><br /><br /><br />Note: The mapping canvas enables you to map the contents of the source data to any level of dimensions. Here, because Budgets are set by product, and by channel for each month, map them to the Month, Product and Channel levels. In the next lesson there is advice techniques for managing situations where source data for different cubes and measures is loaded at different leaf levels of detail.<br /><br /><span style="font-style: italic;">Step 2 - Loading Data into the Cube</span><br />AWM contains a data maintenance wizard to help you create a job to load data into your cubes. The job both loads and aggregates the data within the cube as a single job. You can load:<br /><ul><li>All mapped objects in the analytic workspace</li><li>All mapped measures in a cube including the dimensions</li><li>All mapped measures in a cube excluding the dimensions</li><li>Individually mapped measures</li></ul>To load data, right-click the desired object name into which you are loading data, and then select the Maintain option.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga7bMS6ks0Ztwuh3nyssMwV-51UUle7z3fdN7TPvbqfYeEv0ND34_OvWvFWekk78ipk36xnO7wePtElSYtoCe4OSrYyeAxIDtx7k32yAEytAZXqkH1q2iFW4MfPKZyfmG6jbOnVRS6V9M/s1600-h/image10.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga7bMS6ks0Ztwuh3nyssMwV-51UUle7z3fdN7TPvbqfYeEv0ND34_OvWvFWekk78ipk36xnO7wePtElSYtoCe4OSrYyeAxIDtx7k32yAEytAZXqkH1q2iFW4MfPKZyfmG6jbOnVRS6V9M/s400/image10.JPG" alt="" id="BLOGGER_PHOTO_ID_5157891655107194674" border="0" /></a><br />In this screenshot, the Budgets cube is maintained. This results in the loading of data for all the dimensions that organize the cube and all the mapped measures associated with the cube.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgccwd3qe4ttjrO6qAyVhrUAJZ0LXlG1He03Gomtq8l9MXgXvpprl5prNeK1vS2iRVqUkgrfm5zl2m9QXsEkQO_b6zodnw5bckte7UJcNrXAf4e3-btqHRtyQTzDbHKJ6rsc9ktsmNGQSs/s1600-h/image11.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgccwd3qe4ttjrO6qAyVhrUAJZ0LXlG1He03Gomtq8l9MXgXvpprl5prNeK1vS2iRVqUkgrfm5zl2m9QXsEkQO_b6zodnw5bckte7UJcNrXAf4e3-btqHRtyQTzDbHKJ6rsc9ktsmNGQSs/s400/image11.JPG" alt="" id="BLOGGER_PHOTO_ID_5157891908510265154" border="0" /></a><br /><br /><br />The Maintenance Wizard takes you through a set of steps to load data from the mapped relational objects to the multidimensional objects in the AW.<br /><br />Step 1 of the wizard, you identify the objects for which data is to be loaded. If you choose cubes, all the measures for the cube are selected. Alternatively, you can choose a specific measure of a cube. After a measure or cube is selected, the associated dimensions are automatically selected as well. AWM, by default, selects the related dimensions for the cube. This is because AWM is dimensionally aware, and knows that the dimensions must exist and be populated in order for measures to be loaded (the dimensions organize the measures physically not just logically in an AW, so they must be maintained before the measure data can be loaded).<br /><br /><span style="font-weight: bold;">Note</span> – My personal preference is not to maintain dimensions at the same time as processing the cube. This goes back to the old days of Express Server when it was best practice to load dimensions first and then load data as a separate job. The reason for this two-step process was to ensure efficient storage of a measure. With the OLAP Option I am not sure if this should still be considered best practice but old habits die-hard.<br /><br />From this screen it possible to simply click on the “Finish” button and the job will run immediately. Alternatively you can step through the two other screens to set some additional processing options:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrV_S73tODY72aWZg5HcFXcEslqUQ0FcOoLYWo7YXhRwORViJcscvflDrum5cDoexiDiq4VNdaA6T_k0MvhfmuwFhlO-bOFrFekc9nn4R9L2z_eiAqmTaXMQOP9FxoCyne6oRY81e18j4/s1600-h/image11.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrV_S73tODY72aWZg5HcFXcEslqUQ0FcOoLYWo7YXhRwORViJcscvflDrum5cDoexiDiq4VNdaA6T_k0MvhfmuwFhlO-bOFrFekc9nn4R9L2z_eiAqmTaXMQOP9FxoCyne6oRY81e18j4/s400/image11.JPG" alt="" id="BLOGGER_PHOTO_ID_5157892161913335634" border="0" /></a><br /><br />Step 2 allows you to determine how previously load data should be managed as well as new data. For the moment, simply ignore this screen, all will be explained in the next workshop.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpg6dMNcVyRMIC4Ix8KPMhLpIy0cnJLK8g4jlYsVDTUqkP3Bv15iU1znUnKq5RQdWJvV74VBcNbeqWT1QXmcOru630_DeP8VEMOTada0caXy6fdYfN-lz8qNSnCRgplr7JnpauigBd9_w/s1600-h/image13.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpg6dMNcVyRMIC4Ix8KPMhLpIy0cnJLK8g4jlYsVDTUqkP3Bv15iU1znUnKq5RQdWJvV74VBcNbeqWT1QXmcOru630_DeP8VEMOTada0caXy6fdYfN-lz8qNSnCRgplr7JnpauigBd9_w/s400/image13.JPG" alt="" id="BLOGGER_PHOTO_ID_5157892462561046370" border="0" /></a><br /><br /><br />Step 3 allows you to determine when to run the job. For the moment simply use the default option to run the job immediately. Again, the other options will be explained in the next workshop.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzkcb91l1AmlouQvVchhengG8EH8K4YmhTXW5g-LUYyH-aLtCWUiTqiFrU9amvYH3XIHHrRiStmcnIuIguZK6qB6E6CY6FMJBrgwXAdy-L-JtTJuUneAFBg9zxOkvNY4V1byHW6NVNib0/s1600-h/image12.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzkcb91l1AmlouQvVchhengG8EH8K4YmhTXW5g-LUYyH-aLtCWUiTqiFrU9amvYH3XIHHrRiStmcnIuIguZK6qB6E6CY6FMJBrgwXAdy-L-JtTJuUneAFBg9zxOkvNY4V1byHW6NVNib0/s400/image12.JPG" alt="" id="BLOGGER_PHOTO_ID_5157892754618822514" border="0" /></a><br /><br />After the loading of data is completed, you can view the report which is shown below (this is the 10g report, the 11g report provides a lot more detail):<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh53tYl7Te8tjTtK4gUCvsCx3pNiEe0Aozb82zG08KZURfc4pdxpVU77HJtFSYTWwGj9D61sUotv4HRWvP8jkdaBTIPg4RHkaiLhjy_cWfau-GbyuqZpqVe3LpgDxN5EDE0mtpk-Fx8FSM/s1600-h/image14.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh53tYl7Te8tjTtK4gUCvsCx3pNiEe0Aozb82zG08KZURfc4pdxpVU77HJtFSYTWwGj9D61sUotv4HRWvP8jkdaBTIPg4RHkaiLhjy_cWfau-GbyuqZpqVe3LpgDxN5EDE0mtpk-Fx8FSM/s400/image14.JPG" alt="" id="BLOGGER_PHOTO_ID_5157892939302416258" border="0" /></a><br /><br />After successful completion, the data in your AW is ready to be analyzed.<br /><br /><span style="font-weight: bold;">Note</span> - All the maintenance logging goes into the XML_LOAD_LOG table (for 10g, with 11g there have been some changes which will be explained in a later post), which belongs to the OLAPSYS user. This table can be reviewed later, if required. There is a lot of information in this log, but some of it can be hidden. Always make sure ALL your records were correctly loaded. The log file will tell you if any were rejected, but unfortunately it will not tell you why or which records. The usual reasons are:<br /><ul><li>missing dimension members</li><li>invalid data due to data type errors</li></ul><br /><span style="font-size:130%;">Viewing the Results<br /></span>After data is loaded, you can preview it by using the Data Viewer. To see the data, right-click the name of the measure or cube that you want to view, and then select View Data from the submenu.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpy9yviPgHkxKjQp42rs9kGsmS0R-xWjeSiAk3-uYHh2Pox1TwG-ECbd0euTF56v-o9hebYU01W9Rf254zzrfsCCl4S-Sp9ytU1u0XRAiJq4smSdR77CFHL127IHvdGT1gz7tX7e0mbpg/s1600-h/image15.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpy9yviPgHkxKjQp42rs9kGsmS0R-xWjeSiAk3-uYHh2Pox1TwG-ECbd0euTF56v-o9hebYU01W9Rf254zzrfsCCl4S-Sp9ytU1u0XRAiJq4smSdR77CFHL127IHvdGT1gz7tX7e0mbpg/s400/image15.JPG" alt="" id="BLOGGER_PHOTO_ID_5157893351619276690" border="0" /></a><br />A tabular report appears. If you view a cube, all measures in the cube are displayed. In the Data Viewer, you can:<br /><ul><li>Drill up or down on the dimension values</li><li>Pivot or rotate the view of the data by dragging the edges (rows, columns, and pages) to new positions</li><li>Use the query builder to slice and dice the data<br /></li></ul>This basic crosstab control is used extensively in Oracle Business Intelligence tools, including OracleBI Beans, Discoverer Plus OLAP, and administrative tools such as AWM and Oracle Warehouse Builder. Also, third-party tools and applications sold by Oracle partners that use the OracleBI Beans technology use this same user interface.<br /><br /><span style="font-weight: bold;">Note</span> - When you are developing an analytic workspace always check your data after it has loaded. Do not just assume the data is correct. It always good practice to go back to the fact table and make sure the totals from the source data match the totals in the OLAP cube.<br /><br />In end-user tools and applications, more functionality (such as formatting, colour coding, and cell actions) is enabled in Discoverer Plus OLAP, as you see in the lesson titled “Building Analytical Reports with OracleBI Discoverer Plus OLAP.”<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicURJY1Svrg16JwcycHApRGzy9GH785u3PqeYc5dwA_CBSCpqYHKWmu4eqDpdj16MZYtCNNAbfrQsMGLXgEvkwcfwY3wB6k0_U-l6D5L-YMf-in2uu2Q1CibTcnwLEnI-a1mPJxfGrkUE/s1600-h/image16.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicURJY1Svrg16JwcycHApRGzy9GH785u3PqeYc5dwA_CBSCpqYHKWmu4eqDpdj16MZYtCNNAbfrQsMGLXgEvkwcfwY3wB6k0_U-l6D5L-YMf-in2uu2Q1CibTcnwLEnI-a1mPJxfGrkUE/s400/image16.JPG" alt="" id="BLOGGER_PHOTO_ID_5157893592137445298" border="0" /></a><br /><br /><span style="font-weight: bold;">Note: </span>From the File menu within the Data Viewer, or from the Query Builder tool, <br />you can access the Oracle OLAP Query Builder. This query wizard is used throughout Oracle Business Intelligence tools.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX9Hvdvbt7BA7cTZhC2jR7CInrO-vzcQyenZVQGlTpHdupgjreoJ-gIoTNJpg8Y_GGwReiJItoA02PVKffP3hVcLIeu58iOcAtZzu_IdZXiY5AMpO7hmdVjTGne8SFn-rEwyAS8QD3Eog/s1600-h/image17.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX9Hvdvbt7BA7cTZhC2jR7CInrO-vzcQyenZVQGlTpHdupgjreoJ-gIoTNJpg8Y_GGwReiJItoA02PVKffP3hVcLIeu58iOcAtZzu_IdZXiY5AMpO7hmdVjTGne8SFn-rEwyAS8QD3Eog/s400/image17.JPG" alt="" id="BLOGGER_PHOTO_ID_5157893506238099362" border="0" /></a><br /><br />As shown in the image above, you drill down on data to the lowest levels of detail by clicking the arrow icon to the left of the dimension value. Notice that the measure appears to the user as fully aggregated at all level combinations of all dimensions. This is an important feature of the Oracle OLAP dimensional model. All data is presented to the end user as if it is already aggregated and calculated, even if some or all of the data being displayed is being calculated on the fly.<br /><br />For example, some of the budget data has been pre-aggregated during the maintenance task, and some of it is being calculated dynamically. The end user cannot tell the difference, and does not need to know. The AW contains the data and the calculation logic and presents the results that the user needs. From the technical perspective, not even the query behind this crosstab needs to know whether the measure cells being requested are pre-computed or not. The query simply requests these cells from the database, and the AW engine performs any calculations required at query time.<br /><br />In some cases you may need to move beyond the default settings described in this workshop. Therefore, in the next workshop we will look at the other tabs that are part of the Cube wizard. These tabs control sparsity, compression and partitioning features, aggregation rules, and summarization strategies.Keith Lakerhttp://www.blogger.com/profile/01039869313455611230noreply@blogger.com0tag:blogger.com,1999:blog-3820031471524503731.post-68480039371941281562008-01-14T08:43:00.000-08:002008-12-11T15:25:49.708-08:00OLAP Workshop 4 : Managing Different Types of HierarchiesIn the previous posting we started to look at building our first analytic workspace using Analytic Workspace Manager. At this stage don’t forget that we can also use Warehouse Builder to perform the same tasks and in many cases, especially on large-scale projects, this will be the product of choice for designing, building and maintaining your analytic workspaces.<br /><br />At the end of the last workshop we had defined a simple time dimension and examined the various components that make up a dimension:<br /><ul><li>Levels</li><li>Hierarchies</li><li>Attributes</li></ul>In this workshop we are going to look in more detail at the types of hierarchies that you might need to design and map within your environments.<br /><br />Most dimensions will have at least one hierarchy, but Oracle OLAP does also support completely flat dimensions where no hierarchy exists. Although this is rare it does occur in some cases, but it is always wise to have an “All Members” level for these types of dimensions as this will allow business users to pivot these types of dimensions out of their query by selecting that top level. Otherwise their queries will always be pinned to a single dimension member within the page dimension.<br /><br />A hierarchy defines a set of parentage relationships between all or some of a dimension's members:<br /><ul><li>Used for rollups of data.</li><li>Used for end-user navigation; e.g., drill-down.</li></ul>While multiple hierarchies are supported each member can have only one parent within each hierarchy. Lets look at some basic examples:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUdAjrJcwXUEzxgP6AMy9_4FRKMzNr2TdL2xrMwKWzSKBOJAozCGEJLE4XWqQ-4mklc80PpP23LbvxjdyRoe2Sz9742pzfBsfBfMsn057zkq1tXme7SzRI5RV-bQHPUiHTE8sopYTWexY/s1600-h/Image1.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUdAjrJcwXUEzxgP6AMy9_4FRKMzNr2TdL2xrMwKWzSKBOJAozCGEJLE4XWqQ-4mklc80PpP23LbvxjdyRoe2Sz9742pzfBsfBfMsn057zkq1tXme7SzRI5RV-bQHPUiHTE8sopYTWexY/s400/Image1.JPG" alt="" id="BLOGGER_PHOTO_ID_5151293661922569474" border="0" /></a><br />In the first image we have a traditional level based hierarchy where each child has a parent at the next level up in the hierarchy. Although the number of children at each node may, and usually does, differ between nodes. The second image shows another type of level based hierarchy that is some times referred to as a “Skip Level” hierarchy. This is where a leaf node links to a higher-level parent above its next most obvious level. Oracle database can support skip-level relationships within relational hierarchies, however, this is limited to skipping to only one specific level. Oracle OLAP is able to support skip-levels across multiple levels, as seen here:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCyMAhzjZeW5rmQZS_2UDhyphenhyphen82gnMhM4CCwXMvnTZoe4fnUKh7jERTMceUxq2N0-73AsF6npXEmmUJrUsbO0A6HD5Ri4ncnqk_iSAjvYOG5mHXm1N60aCpOwMrXcLysfRXcylJCvnsVOx4/s1600-h/Image1b.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCyMAhzjZeW5rmQZS_2UDhyphenhyphen82gnMhM4CCwXMvnTZoe4fnUKh7jERTMceUxq2N0-73AsF6npXEmmUJrUsbO0A6HD5Ri4ncnqk_iSAjvYOG5mHXm1N60aCpOwMrXcLysfRXcylJCvnsVOx4/s400/Image1b.JPG" alt="" id="BLOGGER_PHOTO_ID_5151293966865247506" border="0" /></a><br />Oracle OLAP is able to manage these types of relationships quickly and easily because all types of hierarchies are effectively stored as parent-child relationships. A derivation of the skip-level hierarchy is the “Ragged” hierarchy. This is where leaf-nodes are located at different levels within the hierarchy. Obviously this can have an impact on the data loading and aggregation plans, however, Oracle OLAP is more than capable of handling this type of scenario in just the same way as any other level based hierarchy.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis5fYmJcbpfq_ruMeev9gcQWdALwxn18-d5JyU4XKbk4Lv3_zQWr5uVD4qCK97AjUmYfdrFevzEGSqWhlPrAmGtlb8owqu2LQZ1wM0URRFFEPEe1fguW50hhEHX4xIe29Lc6XJUnhKlhI/s1600-h/Image1a.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis5fYmJcbpfq_ruMeev9gcQWdALwxn18-d5JyU4XKbk4Lv3_zQWr5uVD4qCK97AjUmYfdrFevzEGSqWhlPrAmGtlb8owqu2LQZ1wM0URRFFEPEe1fguW50hhEHX4xIe29Lc6XJUnhKlhI/s400/Image1a.JPG" alt="" id="BLOGGER_PHOTO_ID_5151294263217990946" border="0" /></a><br />Of course you can combine some of these structures to create more complicated relationships such as a “Ragged-Skip” level hierarchy. These more complex structures are also supported.<br /><br />The last type of hierarchy shown above is a simple flat hierarchy, which as explained earlier may or may not be an ideal type of dimension to model depending on how your business users plan to build queries. In all these cases, the hierarchy is defined based on levels.<br /><br />One type of hierarchy not shown, but which is supported Oracle OLAP, is “Value” based hierarchies, of which the typical Employee/HR table is the most common example. This type of hierarchy contains no levels and is dealt with as a pure parent-child relationship. In this case the level names are converted into attributes to help business users define the queries.<br /><br />Across all these types of hierarchies there are some simple rules that need to be followed. It is recommended you create at least one top level on each of your hierarchies. Although some types of dimensions, such as time, will require multiple top levels such as Years.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyzFDubpCR81kWNVOV7XmPY4egzIVVF5MYYbCrDwQdqrLy9vSd7NtZnig7D9TPgTAju5weEolXl8MrK_s-nYevBVfIPi_sXodrAGQgS1SUoLJJSWVWR3-WTNYFaYIzCg_Fitzr3RdVhsA/s1600-h/Image2.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyzFDubpCR81kWNVOV7XmPY4egzIVVF5MYYbCrDwQdqrLy9vSd7NtZnig7D9TPgTAju5weEolXl8MrK_s-nYevBVfIPi_sXodrAGQgS1SUoLJJSWVWR3-WTNYFaYIzCg_Fitzr3RdVhsA/s400/Image2.JPG" alt="" id="BLOGGER_PHOTO_ID_5151294589635505458" border="0" /></a><br />What you cannot do is have a child owned by multiple parents within the same hierarchy as shown below. In this case, you would need to create two separate hierarchies to manage the relationships separately.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDppDVbxSzD6d8cM8XdGCiaFEM2t_kQXsxAuE6lNpgmWukkm-vuPOKpHuuEKT2aL4AyLmw1v9Oz5lLfF8ByrK71xk9avgtCgNN_8vBfOdbyUbYY-kYqS3eliVWi8Y9OjRZ1Dj9NxoPWXQ/s1600-h/Image3.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDppDVbxSzD6d8cM8XdGCiaFEM2t_kQXsxAuE6lNpgmWukkm-vuPOKpHuuEKT2aL4AyLmw1v9Oz5lLfF8ByrK71xk9avgtCgNN_8vBfOdbyUbYY-kYqS3eliVWi8Y9OjRZ1Dj9NxoPWXQ/s400/Image3.JPG" alt="" id="BLOGGER_PHOTO_ID_5151294761434197314" border="0" /></a><br />The interesting part here, is the basic design of the dimension and its related levels, hierarchies and attributes is largely consistent across all these different types of structures. The only real different is between level and value-based relationships where value-based dimensions do not contain levels. Fortunately, the dimension loading routines manage these types of dimension structures transparently.<br /><br />The next step, having defined our dimensions and their associated hierarchies, is to map the source data to the actual dimension itself. To help with this process, and to accommodate some of these more complex relationships, the AWM Mapping Editor allows for three types of source data:<br /><ul><li>Star format source table</li><li>Snowflake collection of source tables</li><li>Other</li></ul>Which just allows you to use just about any type of relational schema design as a source in the mapping editor.<br /><br /><span style="font-weight: bold;font-size:180%;" ><span style="font-size:130%;">The Mapping Editor</span><br /></span><br />The mapping editor is laid is comprised of four main areas:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPnHCy_sQJGzU7AEQ8r3s0Fe7K1dQB20rU5IsOciq4wYfeKJq2BTGQ549EPL6RP8Z6cfzU3U0C30QMP_hyphenhyphen7xjmz0rZYxvCwtQfVxAbCw401sU6PAOBTcviVOpNQJ4wCPwznnn2QZK_hyphenhyphenc/s1600-h/image11.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPnHCy_sQJGzU7AEQ8r3s0Fe7K1dQB20rU5IsOciq4wYfeKJq2BTGQ549EPL6RP8Z6cfzU3U0C30QMP_hyphenhyphen7xjmz0rZYxvCwtQfVxAbCw401sU6PAOBTcviVOpNQJ4wCPwznnn2QZK_hyphenhyphenc/s400/image11.JPG" alt="" id="BLOGGER_PHOTO_ID_5155257023383580130" border="0" /></a><br /><br /><ul><li><span style="color: rgb(255, 0, 0); font-weight: bold;">1</span> – The mapping editor is launched from the main navigator. There is a mapping editor for each dimension and each cube.</li><li><span style="font-weight: bold; color: rgb(255, 0, 0);">2</span> – Schema List: lists the available tables, views and synonyms where the owner of the AW has been granted SELECT privilege.</li><li><span style="font-weight: bold; color: rgb(255, 0, 0);">3 </span>– The mapping Canvas: dragging tables views and.or synonym on to the mapping canvas makes it available for use within a mapping.</li><li><span style="color: rgb(255, 0, 0); font-weight: bold;">4</span> – Mapping Control: Controls the type of layout, which includes:</li><ul><li>Star schema</li></ul><ul><li>Snowflake schema</li></ul><ul><li>Other</li></ul></ul><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgJKWEjCnE6bW9B95BIfbyBE2Xq5TbEpTjJ1fULROKfz0mS9TyEnfgToNrPBS4hG97duZHw24AJyIIBkA8TepzT0O2niA0GmpsmyTjgveqW8SeiMh51yeW000MRpEpeJpsdijEe47zcck/s1600-h/image10.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgJKWEjCnE6bW9B95BIfbyBE2Xq5TbEpTjJ1fULROKfz0mS9TyEnfgToNrPBS4hG97duZHw24AJyIIBkA8TepzT0O2niA0GmpsmyTjgveqW8SeiMh51yeW000MRpEpeJpsdijEe47zcck/s400/image10.JPG" alt="" id="BLOGGER_PHOTO_ID_5155256933189266898" border="0" /></a><br /><br /><br /><br />In the following sections we will look at how to use the mapping editor to manage different schema layouts to model different types of dimensions and hierarchies.<br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Types of Dimension Source Tables/Views</span><br /></span>Firstly, a quick best practice tip. Personally, I always find it useful to map to views rather than directly to tables. This provides more control over the data passed into the data loader (which can be useful for testing), especially when trying to perform incremental updates from a fact table. But we will look at this in more detail when reviewing processes for designing and building cubes.<br /><br /><span style="font-weight: bold;">Star</span><br />A star schema provides one table or view with columns containing member id's representing all levels of a hierarchy for each dimension. Each row in the table specifies a branch in the hierarchy. Additional columns identify additional attributes for each level, such as long and short descriptions. In the case of a time dimension, additional attributes will be required to provide information on end date and time span for each level.<br /><br />Where a hierarchy is unbalanced and contains skip-levels, or is ragged, or is a combination of both, some rows may contain blank entries in specific columns.<br /><br />OLAP dimension member ids must be unique within a level, which is normal in relational models, but they may also need to be unique across levels as well. In fact most people forget or try to ignore this requirement and often hit problems later when loading data into their cubes. OLAP stores dimension members as a single continuous list of ids. If your source keys are not unique across levels then you must take the option of generating surrogate keys as stated in the previous workshop.<br /><br />Enabling the surrogate key option appends the level name to the member id, which should then guarantee uniqueness. However, this is only possible with value-based hierarchies. If your dimension requires a value based hierarchy you must use natural keys.<br /><br />In summary:<br /><ul><li>Natural keys:</li><ul><li>Created in the AW as is from the source table or view (except numeric, dates become text).</li></ul><ul><li>If source table had months 1, 2, 3 then the AW dimension values would be '1', '2', '3'.</li></ul><li>Surrogate keys:</li><ul><li>The level name is prefixed to the source table or view id value.</li><li>If source table had months 1, 2, 3 then the AW dimension values would be 'MONTH_1', 'MONTH_2', 'MONTH_3'</li></ul></ul><span style="font-weight: bold;">Mapping a Star Based Schema</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWsbejMpQbORLUEUX1bUwtsD8OpUaHa-DrKniumbX2_KrwZaoA3zqWMFj6BNUWaI_QEL3OJRB1ZxKJnJFnAIUJdjgMWUjGDvNVvUdZa9tUp8lTAfO6n0bXt4OS_EvFc6gVvLp9FD6HQzM/s1600-h/Image4.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWsbejMpQbORLUEUX1bUwtsD8OpUaHa-DrKniumbX2_KrwZaoA3zqWMFj6BNUWaI_QEL3OJRB1ZxKJnJFnAIUJdjgMWUjGDvNVvUdZa9tUp8lTAfO6n0bXt4OS_EvFc6gVvLp9FD6HQzM/s400/Image4.JPG" alt="" id="BLOGGER_PHOTO_ID_5151295616132689234" border="0" /></a><br />The steps for using a star schema are:<br /><ul><li>Use natural or surrogate keys allowed</li><ul><li>Must use surrogate keys if dimension values are not unique across levels.</li></ul><li>Define levels and a level-based hierarchy.</li><li>In the mapping editor choose Star Schema as the Type of Dimension Table(s).</li></ul><span style="font-weight: bold;">Dimension Objects used in the Mapping</span><br />The Mapping Editor allows mapping from the source table to the member and attributes at each level. Each attribute is shown as a separate entry in the dimension object in the editor. The editor will not allow mappings from more than one column to each element, although AWM 11g removes the restriction by allowing simple transformations to be performed during the data loading process.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZaFWYRV0OctbTTTzyo_yB0dUup3EBYzZ7Qnc6tIkrjl8Dg9dixUaswIa7CmRcTYfI210CRTWsBUWPUl-c2J5OuMJn-XbM0ofuLFGHSgxemPKOL4-WY69-BK4YaJWIZLtQEkwHBqlK9eo/s1600-h/Image6.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZaFWYRV0OctbTTTzyo_yB0dUup3EBYzZ7Qnc6tIkrjl8Dg9dixUaswIa7CmRcTYfI210CRTWsBUWPUl-c2J5OuMJn-XbM0ofuLFGHSgxemPKOL4-WY69-BK4YaJWIZLtQEkwHBqlK9eo/s400/Image6.JPG" alt="" id="BLOGGER_PHOTO_ID_5151296002679745890" border="0" /></a>Here is an example of a completed mapping for the Product dimension. Note the long and short description attributes share the same source (so it is possible to map a source column to multiple target attributes).<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkBODXQef2Ej6pI9a1ozT5A82PKy4LXVtVPizIqyqTnsgTw-ZOKmBnYJBkhZF8GZWuor3GkEjmIZRsrM1hiROybhZL2B3MDciVpuzDvmjVPLw4-pc2tzLRWMl63jJdrq24HN_DcUg7BkY/s1600-h/Image5.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkBODXQef2Ej6pI9a1ozT5A82PKy4LXVtVPizIqyqTnsgTw-ZOKmBnYJBkhZF8GZWuor3GkEjmIZRsrM1hiROybhZL2B3MDciVpuzDvmjVPLw4-pc2tzLRWMl63jJdrq24HN_DcUg7BkY/s400/Image5.JPG" alt="" id="BLOGGER_PHOTO_ID_5151296097169026418" border="0" /></a><br />Some query tools will differentiate between long and short descriptions. For example both Discoverer and the OLAP Spreadsheet Addin for Excel will use short descriptions for dimensions used as column headers and long descriptions when the dimension is used in the page or row edge.<br /><br />If you do not provide a long and./or short description the data loader will default to using the dimension key to populate these attributes.<br /><br /><span class="Apple-style-span" style="font-weight: bold;">Snowflake</span><br />A snowflake schema provides separate tables or views for each levels of a hierarchy. Each row in the table specifies a level in the hierarchy with an additional column to link to each parent across the various hierarchies. The same basic requirements apply as for star schemas in terms of uniqueness.<div><br /><span style="font-weight: bold;">Mapping a Snowflake Based Schema<br /><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhepSxp_jDCqWWZj1aT40G1fqvmAZmYNEwGYEPf6xXaMCPCifs6biXJ1ojcLQYxgTn6FCiVr1rGee3byHQ1lqn9VAje8qYVHfFC8AFVyGuQQy0K-2da4z7dsq5vGDaLIIukV-pmd-d2u94/s1600-h/Image7.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhepSxp_jDCqWWZj1aT40G1fqvmAZmYNEwGYEPf6xXaMCPCifs6biXJ1ojcLQYxgTn6FCiVr1rGee3byHQ1lqn9VAje8qYVHfFC8AFVyGuQQy0K-2da4z7dsq5vGDaLIIukV-pmd-d2u94/s400/Image7.JPG" alt="" id="BLOGGER_PHOTO_ID_5151296810133597570" border="0" /></a><br />The steps for using a snowflake schema are:<br /><ul><li>Natural or surrogate keys allowed</li><ul><li>Must use surrogate keys if dim values are not unique across levels.</li></ul><li>Define levels and a level-based hierarchy.</li><li>Choose Snowflake schema as the Type of Dimension Table(s).</li></ul><br /><span style="font-weight: bold;">Dimension Objects used in the Mapping</span><br />The mapping editor has to be switched to “Snowflake” mode using the pulldown selection dialog at the top of the editor. The mapping canvas will then change to allow you to map each member, its parent and associated attributes at each level.</div><div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXHBiu3mNQocNTzLoJi0cMYRszYdFE7VzW0T-y0IyTBpTDwJjlAVt3ZyAJXjYpqwEsbI4JqalgCRj3IECsb4TBV-WlJLZnoSj06cGSpGALFEmNcc755CDccRw3sK8fSV8OydLzVXzKW18/s1600-h/Image9.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXHBiu3mNQocNTzLoJi0cMYRszYdFE7VzW0T-y0IyTBpTDwJjlAVt3ZyAJXjYpqwEsbI4JqalgCRj3IECsb4TBV-WlJLZnoSj06cGSpGALFEmNcc755CDccRw3sK8fSV8OydLzVXzKW18/s400/Image9.JPG" alt="" id="BLOGGER_PHOTO_ID_5151297308349803922" border="0" /></a><br />As with the Star schema mapping process, the snowflake mapping editor will not allow mappings from more than one column to each element i.e., map from a single source table or view per level. Here is a completed snowflake mapping:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm6MM61L2ZEbWE2Vj-dwTnEXx0rpoWRBPgoJeJ8FE_n-mQIQ5zRLiVrb1gNyJZ3eXlnNLtzC-j10ZMkzekqXspfxS4QnsqCGn9DQ3amy8S5dPAF20BD9k2s8a_Ks9yR0HlWgDnL4u2nnQ/s1600-h/Image8.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm6MM61L2ZEbWE2Vj-dwTnEXx0rpoWRBPgoJeJ8FE_n-mQIQ5zRLiVrb1gNyJZ3eXlnNLtzC-j10ZMkzekqXspfxS4QnsqCGn9DQ3amy8S5dPAF20BD9k2s8a_Ks9yR0HlWgDnL4u2nnQ/s400/Image8.JPG" alt="" id="BLOGGER_PHOTO_ID_5151297493033397666" border="0" /></a><br /><br /><span class="Apple-style-span" style="font-weight: bold;">Collection of Tables</span><br />The basic snowflake schema can be taken a stage further by moving the various attributes, such as descriptions etc, to separate tables. This follows a more 3NF approach to data storage and although it looks more complicated it can easily be managed within AWM's mapping editor.<br /><br /><br /><span style="font-weight: bold;">Mapping a Collection Based Schema</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMYUVoMzKa5GaU_lpe_tzCVMRti0ia3QN2aP3_KG7ldL2lQzJ_3aodEPSQqF8Wlu3bcMuX0HOFcnIiZjqCyFUtEdaGqPCaoYtnk5rdzJHFu1IR-lyKgFi7CNMjnwZjceJIrbc58CJHuas/s1600-h/image12.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMYUVoMzKa5GaU_lpe_tzCVMRti0ia3QN2aP3_KG7ldL2lQzJ_3aodEPSQqF8Wlu3bcMuX0HOFcnIiZjqCyFUtEdaGqPCaoYtnk5rdzJHFu1IR-lyKgFi7CNMjnwZjceJIrbc58CJHuas/s400/image12.JPG" alt="" id="BLOGGER_PHOTO_ID_5155280319286193650" border="0" /></a><br /><br />In this format natural or surrogate keys can still be used within the dimension. To map a collection of tables as described above the mapping editor needs to be switched to “Other” mode.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs65aiKIBLF509V4LfYQQdsLT8JzHSmW01qmbdAQekYrTm4CyVWnfx1Rtm0pzrOS5Ej-iK-91KhS9VPzrSbxIZuSRWjIS9qmnqRIeT-cPIv2NY3bTGvdaZU7r-Afa_Ar8BTVebAR7rzIg/s1600-h/image13.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs65aiKIBLF509V4LfYQQdsLT8JzHSmW01qmbdAQekYrTm4CyVWnfx1Rtm0pzrOS5Ej-iK-91KhS9VPzrSbxIZuSRWjIS9qmnqRIeT-cPIv2NY3bTGvdaZU7r-Afa_Ar8BTVebAR7rzIg/s400/image13.JPG" alt="" id="BLOGGER_PHOTO_ID_5155280409480506882" border="0" /></a><br /><br /><br />When mapping the tables to the dimension, the normal rules still apply. The Mapping Editor only allows mapping to member, parent for dim values and member, value for attributes at each level. It will not allow mappings from more than one column to each element, but you can map from an arbitrary set of source tables and/or views, which have member and value columns.<br /><br /><br /><br /><br /><span style="font-weight: bold;">Value Based (Parent Child)</span><br />This is probably the most simple type of relationship to manage from a mapping perspective. Likely sources for this type of mapping are other AWs, where the source data is from an OLAP enabled SQL view, or another multi-dimensional engine.<br /><br />The source for this type of relationship is normally a two-column table that provides the key and the parent for each child. Other columns are used to provide additional attributes.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk4LV3emDvLcv9qQww1o2qydik9j-QMh3RhJneIdIGH2bDCsEC308LWeDI84ZI8RGq0v-pPMzd4d1sXN9ajhRZnCWubG8roF_AMbOZ5k0cEJzy4X2qkw9u-DeTs5-nDe_cg_1l9qGI4_U/s1600-h/image14.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk4LV3emDvLcv9qQww1o2qydik9j-QMh3RhJneIdIGH2bDCsEC308LWeDI84ZI8RGq0v-pPMzd4d1sXN9ajhRZnCWubG8roF_AMbOZ5k0cEJzy4X2qkw9u-DeTs5-nDe_cg_1l9qGI4_U/s400/image14.JPG" alt="" id="BLOGGER_PHOTO_ID_5155280491084885522" border="0" /></a><br /><br />In this case, natural keys must be used to define the dimension, since there are no level identifiers that can be used to construct the surrogate key. In this scenario it is possible to use any of the mapping editor options (star, snowflake, or other) to construct the mapping.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPSedTicDKYT1Aws3_goOyt5obblIvJulDaVWTk-rGb3Y6oIQhWQYXogIsCjNdooi1ox90oizGVZ4jPs02iLrLyFSZaehJJn5yTy8K7IS21Eca7wwOdJJ9hg_DnJt2BRXhN4GMJS0lHR4/s1600-h/image15.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPSedTicDKYT1Aws3_goOyt5obblIvJulDaVWTk-rGb3Y6oIQhWQYXogIsCjNdooi1ox90oizGVZ4jPs02iLrLyFSZaehJJn5yTy8K7IS21Eca7wwOdJJ9hg_DnJt2BRXhN4GMJS0lHR4/s400/image15.JPG" alt="" id="BLOGGER_PHOTO_ID_5155280551214427682" border="0" /></a><br /><br />Things to remember when designing a parent-child/value based hierarchy. Firstly, there are no levels, therefore, certain calculations, such as share, are not possible. A parent-child hierarchy cannot be used in the partition statement of a cube because there is no level identifier to act as the partition key.<br /><br />However, it is possible to provide a pseudo level identified by creating a level attribute. This allows users to create selections using the attribute in the normal way. In some cases, a value based hierarchy may be the only way to manage an unbalanced hierarchy, where not all branches have the same number of dimension members).<br /><br /><span style="font-weight: bold;">Flat List</span><br />Another version of the parent-child/value based hierarchy is the flat-list dimension. In this scenario, the dimension has no hierarchies and is simply a flat list of dimension members. Personally, I would not recommend building this type of dimension simply because there is no top level. This makes it difficult for business users to pivot the dimension out of the query since they have to pin the dimension to a specific member when it is hidden. This can make the query process more complicated for business users to understand.<br /><br />In most cases I would suggest that a flat list hierarchy where no top level is possible is a likely candidate for migration to a series of measures within a cube. This is something you should seriously consider before creating a flat list dimension.<br /><br />The dimension itself can have a hierarchy based on a single level. This provides the flexibility to use either surrogate or natural keys. If the dimension is designed with no levels and no hierarchy then only natural keys are available.<br /><br /><br /><span style="font-weight: bold;">Skip, Ragged and Ragged-Skip Level Hiearchies</span><br />Ragged is a special form of skip. The diagram below shows the various scenarios that can be found in many dimensions. It is highly likely that at least one dimension in a data model will have one or all of these scenarios.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaYlM6XIjABRpviX_79JvJV7eKg0oSVCcsUE-ztKPOakVB60lDHc7KUIfBFC_QSt7cbC_EzUCCPBKzABlSZGj5nZy8gvIIUt7H-9fWurgIJ9ydsc8o05tN8CPcU7iwyR2BuujhTON8cA/s1600-h/image16.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaYlM6XIjABRpviX_79JvJV7eKg0oSVCcsUE-ztKPOakVB60lDHc7KUIfBFC_QSt7cbC_EzUCCPBKzABlSZGj5nZy8gvIIUt7H-9fWurgIJ9ydsc8o05tN8CPcU7iwyR2BuujhTON8cA/s400/image16.JPG" alt="" id="BLOGGER_PHOTO_ID_5155284347965517362" border="0" /></a><br />The question is how can such a structure be represented within a relational table?<br /><br />Skip<br />Using an across format structure, where a skip level occurs one or more columns are left blank within a specific row. However, within a skip level there is a common leaf node that denotes the lowest level of the hierarchy. From the leaf node to the top level, certain columns that relate to parents of the leaf node are left blank. As shown below (in this case the ID columns are not shown but follow the same pattern)<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjexuEwFzUvGms9l10wKeAoLcwOH8mC3WN_VbFcnwO3IqWdLA8D4aZsQ0xzn58mwjMA6jG3b1CZG2DnxYZ9jEBdUh5KVIptti53DSAQ-lObemB-m3NADcbTcK38Qwa5Kvp7RnOepIL-i28/s1600-h/image17.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjexuEwFzUvGms9l10wKeAoLcwOH8mC3WN_VbFcnwO3IqWdLA8D4aZsQ0xzn58mwjMA6jG3b1CZG2DnxYZ9jEBdUh5KVIptti53DSAQ-lObemB-m3NADcbTcK38Qwa5Kvp7RnOepIL-i28/s400/image17.JPG" alt="" id="BLOGGER_PHOTO_ID_5155284648613228098" border="0" /></a><br />This type of layout is difficult, if not possible, for most SQL based query tools to manage. However, recent additions to the SQL language has allowed skip-level hierarchies to be partially managed using normal query methods. However, it is only possible to skip one level within a single hierarchy. Fortunately, OLAP does not enforce this constraint.<br /><br />To map this type of hierarchy use a normal star schema approach. The OLAP engine will manage the complexity of the relationships for you.<br /><br />Ragged<br />For a ragged hierarchy, the leaf node will occur at any or all-intervening levels within a hierarchy. Again null values will appear in certain columns within each row.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzJ5eTP_DZnbd9IMP0KYyy8I4Ms25RkUMMfcjpCbof2w91ezwLMfqNc0UK1lAXyNSIxw65rY7kkWiPcw0Obgkl0iBTff4wz3PxAjc6TK4g12ImyrJj1UR16DMpT7D-K1gypedVmHWLnWQ/s1600-h/image18.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzJ5eTP_DZnbd9IMP0KYyy8I4Ms25RkUMMfcjpCbof2w91ezwLMfqNc0UK1lAXyNSIxw65rY7kkWiPcw0Obgkl0iBTff4wz3PxAjc6TK4g12ImyrJj1UR16DMpT7D-K1gypedVmHWLnWQ/s400/image18.JPG" alt="" id="BLOGGER_PHOTO_ID_5155284863361592914" border="0" /></a><br /><br />When defining a ragged hierarchy within a dimension wse natural keys and create a level-based hierarchy(ies). Within the dimension-mapping editor map the source table as a star. But for the cube mapping the fact table requires a little more work. It is necessary to map the key for the ragged dimension to all levels in the dimension, which have leaf values (or, to be safe, map to all levels). This is shown below<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuhLTFCwjeCeRlF2c6jS1ziuSTa1khXR6B8WhGugJf0LlexUGssmej545FAb0qt7WdBBDPpAmxlj7xLtRjL4XIeX3IXHj2jTGcP3gEfV2w6HkN5Q0FgA5JsS6koyZL518cmVOG_Scakm0/s1600-h/image19.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuhLTFCwjeCeRlF2c6jS1ziuSTa1khXR6B8WhGugJf0LlexUGssmej545FAb0qt7WdBBDPpAmxlj7xLtRjL4XIeX3IXHj2jTGcP3gEfV2w6HkN5Q0FgA5JsS6koyZL518cmVOG_Scakm0/s400/image19.JPG" alt="" id="BLOGGER_PHOTO_ID_5155289347307449970" border="0" /></a><br /><br /><br />Ragged Skip Level<br />In this scenario, looking at the image at the start of this sectio, we can see the leaves are not always at lowest level; there are some intervening nulls However, this simply a combination of the two types of hierarchies we have already reviewed. The source table would look something like this:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi422m8dlHFBfA7C3SUwq_oaBOgUgwBnndVVt9ormFYrCHbKHYXbKZ7ReA0NoNZVClXzB8uzDcOuRt7Ua1x7br35XPC5pFm4ivw_vOH9LXVbMNEbyd3BoMzNa3p0F1DJvjaAMoD-_xP12c/s1600-h/image20.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi422m8dlHFBfA7C3SUwq_oaBOgUgwBnndVVt9ormFYrCHbKHYXbKZ7ReA0NoNZVClXzB8uzDcOuRt7Ua1x7br35XPC5pFm4ivw_vOH9LXVbMNEbyd3BoMzNa3p0F1DJvjaAMoD-_xP12c/s400/image20.JPG" alt="" id="BLOGGER_PHOTO_ID_5155289828343787154" border="0" /></a><br /><br />In this scenario the same rules apply as before:<br /><ul><li>Use natural keys, level-based hierarchy(ies).</li><li>Map as a star.</li><li>When map the fact table, map its key to all levels in the dimension which have leaf values. </li></ul><br />In the next posting in this series we will consider how to design and create cubes.<br /><a href="javascript:void(0)" tabindex="10" onclick="return false;"><span></span></a><br /><br /><br /></div>Keith Lakerhttp://www.blogger.com/profile/01039869313455611230noreply@blogger.com1tag:blogger.com,1999:blog-3820031471524503731.post-85949100199357763542007-12-31T08:35:00.000-08:002008-12-11T15:25:54.382-08:00OLAP Workshop 3 : Building an Analytic WorkspaceIn this lesson, we look at how to use the Analytic Workspace Manager 10g (AWM 10g) tool in conjunction with 10g OLAP to build multidimensional database objects. We will use AWM to perform the following tasks:<br /><ul><li>Create an analytic workspace</li><li>Define dimensions</li><li>Define cubes</li><li>Load data from source relational tables</li><li>View data</li></ul>Throughout this post I have tried to add observations and best practices I have picked up while working with various customers across the US and EMEA. As a result I am going to split this posting into possibly three postings:<br /><ul><li>Create an analytic workspace and defining dimensions</li><li>Modelling and mapping different types of dimensions</li><li>Define cubes and load data from source relational tables</li></ul>So what is the difference between AWM and OWB? AWM should be considered an “EL” tool, it does not contain transformation tools (in AWM 11g simple transformations are possible), for building analytic workspaces. .The target audience for AWM is business users and also developers already using another ETL tools that does not provide support for OLAP data modelling.<br /><br />For this workshop we are going to focus on using AWM. For more information on using OWB to build OLAP data models see the links posted in Workshop 2.<br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Building Blocks of the Multi-dimensional Model<br /></span></span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcedAjVZTYtqhacGps231gWcWbwuaHz82dZhVs8QE09aK6Z8sCNPzosH_PLUSYHcKTvPU6kP72Gi2K351eXY3I5o7O9lzXohKWYPLqNY-xfUwYaEdhG1_0iV-YWrAxmvKvoqDP1cESuac/s1600-h/image1.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcedAjVZTYtqhacGps231gWcWbwuaHz82dZhVs8QE09aK6Z8sCNPzosH_PLUSYHcKTvPU6kP72Gi2K351eXY3I5o7O9lzXohKWYPLqNY-xfUwYaEdhG1_0iV-YWrAxmvKvoqDP1cESuac/s400/image1.JPG" alt="" id="BLOGGER_PHOTO_ID_5151283779202821138" border="0" /></a><br /><br />The first step is design the logical data model, including the dimensions and measures that are needed in the AW. Obviously Warehouse Builder provides the perfect environment for creating a logical data model, and there are some presentations that cover this on the OWB OTN Home.<br /><br />However, if you prefer a more to use a pure data modelling tool then I would recommend looking at CWD4ALL from one of our partners, <a href="http://www.cwd4all.com/">IKAN</a>. To quote directly from their website:<br /><br /><span style="font-style: italic;">"CWD4ALL is a database & OLAP modeling and design tool, fully conformant to the OMG CWM™ specifications. Its advanced modeling and design capabilities provide the means to align your modeling activities with this new worldwide standard. CWD4ALL provides both forward and reverse engineering functionalities. Reverse engineering constructs a graphical model from your existing DB/2, UDB, Oracle and SQL Server 2000/2005 database or schema, which on their part can be forward engineered to an Oracle relational model and the corresponding DDL or Oracle Analytical Workspaces.</span><br /><br /><span style="font-style: italic;">Multi-dimensional modelling and OLAP</span><br /><span style="font-style: italic;">The multi-dimensional model is integrated with the CWD4ALL data models, which stay on top them and use metadata from the logical model and therefore can be mapped to different implementations of relational models. Thus schema and naming independence for used tables and columns is provided, allowing a high flexibility during deployment of the model. Detailed and compact multi-dimensional diagrams provide an easy way to define dependencies in the multi-dimensional model even going beyond possibilities of traditional Star and Snowflake schemas. The multi-dimensional model provides support for OLAP & Oracle Analytical Workspaces. For relational data warehousing you will be able to deploy definitions of levels, dimensions and hierarchies to the Oracle dictionary, thus building a basis for the query rewrite option of the Oracle database. Moreover it will assist in building materialized view definition and defining bitmap join indexes. For Oracle OLAP data warehouse, CWD4ALL will deploy the multi-dimensional model to Oracle 10g Analytical Workspaces and assist in defining the SQL path to calculations in Oracle Analytical Workspaces through view definitions based on OLAP-TABLE functionality. In addition to designing and maintaining correct database relational model behaviour, CWD4ALL allows the designer to examine and specify actual application behaviour so that space management, undo datasets and the full range of implementation-specific parameters can be modeled and defined appropriately.</span><br /><br />For more information on CWD4ALL click <a href="http://www.cwd4all.com/index.asp?pageID=63&parMen=56&siteID=3">here</a> to go to the website.<br /><br />Obviously AWM can also help you design your logical data model but there is one important difference between AWM and OWB/CWD4ALL. AWM is best described as “design time at run time” which means as you create dimensions, cubes etc using AWM the object is created immediately in the analytic workspace, i.e. there is no deployment phase. Which from a business user perspective makes this an ideal product as it simplifies the whole process.<br /><br />In this workshop we will create the following model based on the sales history schema (SH)<br /><br />Dimensions<br /><ul><li>Time: Shows how data varies over time </li><li>Product: Shows how data varies by product</li><li>Geography: Shows how data varies by geography</li><li>Channel: Shows how data varies according to each distribution channel</li></ul><br />Stored Measures<br /><ul><li>Sales </li><li>Costs</li><li>Quantity</li></ul><span style="font-weight: bold;">Examining the Logical Model: </span><br />Dimensions<br />After you have identified dimensions, you can identify the levels of summarization within each dimension. Analysis requirements reveal that:<br /><ul><li>Channel dimension has three levels: Total, Class, and Channel</li><li>Geography dimension has four levels: Total, Region, Subregion, and Country</li><li>Product dimension has four levels: Total, Category, Subcategory, and Product.</li><li>Time dimension has three levels: Year, Quarter, and Month.</li></ul>Note with OLAP dimensions and additional top level is always added to allow business users to fully analyse. In Excel terms this provides the “All” level, or in relational terms allows the dimension to be pivoted out of the query.<br /><br />Cubes<br />Cubes provide a convenient way of collecting similar measures of the same dimensionality. It is not uncommon for many measures to have the same shape, and so by defining their shape (and other shared characteristics) for a cube, you can save time when building your AW. Multidimensional cubes are stored in AWs. A particular AW may contain more than one cube, and each cube may describe a different dimensional shape.<br /><br />Dimensions defined the edges of a cube. Although there is no limit to the number of edges of a cube, BI tools typically organize the display along three edges: row edge, column edge, and page edge. A single dimension or multiple dimensions can be placed on each edge.<br /><br />A cube is simply a logical object that helps an administrator to build and maintain an AW. It also aids in the definition of measures with common characteristics, such as sparsity patterns and aggregation rules. Measures in the same cube have the same relationships to other logical objects and can easily be analyzed and displayed together.<br /><br />In this lesson, we will create our first cube, Sales, containing three measures. These are base measures, which store the facts collected about the business.<br />Each measure that belongs to a particular cube shares particular characteristics with other measures in the cube, such as the same dimensions. The Sales cube includes:<br /><ul><li>Dimensions: Time, Geography, Product, and Channel</li><li>Measures: sales, costs, quantity</li></ul>The data for these measures, and the dimensions that organize the measures, will be sourced from tables in the SH schema, as discussed in the next slide.<br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Getting Started</span><br /></span><span style="font-weight: bold;">Configuring your database:</span><br />This is an area that seems to cause the most problems. This is always surprising to me considering that OLAP 10g is completely integrated into the database engine. The key here is making sure you have the correct patches applied to your database kernel and database instance. You can validate your existing configuration against the OLAP certification matrix, which can be viewed from here:<br /><br /><a href="http://www.oracle.com/technology/products/bi/olap/collateral/olap_certification.html">http://www.oracle.com/technology/products/bi/olap/collateral/olap_certification.html<br /></a><br />When applying database patches please note that the majority of patches are composed of two parts. Firstly you need to use the Universal Installer to apply the kernel updates. Secondly your database instance needs to be upgraded via a series of SQL scripts. This is all documented but many people get caught out.<br /><br />In this case I am using 10.2.0.3 version of the database (Note that OLAP is available only in the Enterprise Edition of the database and is a costed option) with an additional OLAP patched described as the “OLAP A Patch” in Metalink. All this is explained in the certification matrix as stated above.<br /><br />You can quickly and easily check the status of your schema by connecting to your database instance using SQLPlus (or use SQLDeveloper) and run the following commands:<br /><span style="font-size:85%;"><br /><span style="font-family:courier new;">col comp_name format a25 heading 'Component'</span><br /><span style="font-family:courier new;">col version format a12 heading 'Version'</span><br /><span style="font-family:courier new;">col status format a10 heading 'Status'</span><br /><span style="font-family:courier new;">col modified heading 'Modified'</span><br /><br /><span style="font-family:courier new;">SELECT comp_name, version, status, modified </span><br /><span style="font-family:courier new;">FROM dba_registry </span><br /><span style="font-family:courier new;">WHERE comp_name like '%OLAP%';</span><br /><br /><span style="font-family:courier new;">Component Version Status Modified</span><br /><span style="font-family:courier new;">------------------------- ------------ ---------- --------------------</span><br /><span style="font-family:courier new;">OLAP Analytic Workspace 10.2.0.3.0 VALID 19-NOV-2006 08:13:33</span><br /><span style="font-family:courier new;">Oracle OLAP API 10.2.0.3.0 VALID 19-NOV-2006 08:13:35</span><br /><span style="font-family:courier new;">OLAP Catalog 10.2.0.3.0 VALID 19-NOV-2006 08:13:38</span><br /></span><br /><br />Setting up AWM<br />The first step is to download AWM from the OTN OLAP home page:<br /><br /><a href="http://www.oracle.com/technology/software/htdocs/devlic.html?url=http://download.oracle.com/otn/java/olap/AWM_102030A_Win32.zip">http://www.oracle.com/technology/software/htdocs/devlic.html?url=http://download.oracle.com/otn/java/olap/AWM_102030A_Win32.zip<br /></a><br />and the associated readme file that explains installation requirements is here:<br /><br /><a href="http://www.oracle.com/technology/products/bi/olap/awm102030A_readme.html">http://www.oracle.com/technology/products/bi/olap/awm102030A_readme.html<br /></a><br />After installing AWM you can run the awm.exe file located in the ..awm/bin directory or click on the desktop icon.<br /><span style="" lang="EN-GB"></span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZHife1c-vGt3cco8QLDIvxMDz_CD0Zi96nRht45ngWkQU52aDVLmllQJh2UZX0K3zvnN9EuDUavh3tCLXy2wAAAS9TxokioRjFbWakP9xZ0Om9s8LVymEpATVpSiyLtrTF9fS0Xzzf3A/s1600-h/image2.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZHife1c-vGt3cco8QLDIvxMDz_CD0Zi96nRht45ngWkQU52aDVLmllQJh2UZX0K3zvnN9EuDUavh3tCLXy2wAAAS9TxokioRjFbWakP9xZ0Om9s8LVymEpATVpSiyLtrTF9fS0Xzzf3A/s400/image2.JPG" alt="" id="BLOGGER_PHOTO_ID_5151285806427384866" border="0" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVaqG9fx5L_Zl5vEspLZw2CPjJKPsPxvBM4A-yBo2fcPV5IoUI3fj0SX9ICFGPNnYgUi51jX1_mhyphenhyphenm_8RjTIuFLS-LF7mVmLrn_lPcObB4vdDGW-opX90U3-wjs0cxRNhQwEB38pNiCeQ/s1600-h/image3.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVaqG9fx5L_Zl5vEspLZw2CPjJKPsPxvBM4A-yBo2fcPV5IoUI3fj0SX9ICFGPNnYgUi51jX1_mhyphenhyphenm_8RjTIuFLS-LF7mVmLrn_lPcObB4vdDGW-opX90U3-wjs0cxRNhQwEB38pNiCeQ/s400/image3.JPG" alt="" id="BLOGGER_PHOTO_ID_5151285930981436466" border="0" /></a><br /><br /><span style="font-weight: bold;">Making a connection to your database instance</span><br />The first step is to create a new user to own our analytic workspace. For this example we will create a user called SH_OLAP and this user will need to have a special role assigned to it to allow the user to create and manage analytic workspaces. This role is OLAP_USER. Some people are often tempted to use a different role, OLAP_DBA. This is similar to providing a normal user with the DBA privileges. Do not be tempted to use this role as provides a lot of additional privileges that can in some cases cause lots of problems during use. This role should only be assigned to the user OLAPSYS.<br /><br /><span style="font-size:85%;"><span style="font-family:courier new;">CREATE USER "SH_OLAP" PROFILE "DEFAULT" </span><br /><span style="font-family:courier new;"> IDENTIFIED BY "SH_OLAP" DEFAULT TABLESPACE "SH_OLAP" </span><br /><span style="font-family:courier new;"> TEMPORARY TABLESPACE "SH_OLAP_TEMP" </span><br /><span style="font-family:courier new;"> ACCOUNT UNLOCK;</span><br /><span style="font-family:courier new;">GRANT "CONNECT" TO "SH_OLAP";</span><br /><span style="font-family:courier new;">GRANT "OLAP_USER" TO "SH_OLAP";</span><br /></span><br />This user will need SELECT privileges on the source tables that will be used to populate the dimensions and the cubes.<br /><br />As a best practice I will normally assign my OLAP user to its own tablespace and create a temp tablespace specifically for that user as well. The reasons for this will become evident later when we look at what happens during the loading of data into a dimension and/or a cube. Make sure this new user has sufficient quota on both these tablespaces.<br /><br />When you start AWM for the first time you will need to define a new connection to your database instance.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJl373b9pL1-vypvgXuxzWZaCei1R6Z_dBAiQorm7IjTjWHYs-5KGpBcSAl_WsE7Mxn-2P4URS0_jNy4_Q4hroIHNx9wd6mW3HGK5SnylmQwbtKZcocXoLbdMGxl16rcX2LoL0gN1kxMk/s1600-h/image5.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJl373b9pL1-vypvgXuxzWZaCei1R6Z_dBAiQorm7IjTjWHYs-5KGpBcSAl_WsE7Mxn-2P4URS0_jNy4_Q4hroIHNx9wd6mW3HGK5SnylmQwbtKZcocXoLbdMGxl16rcX2LoL0gN1kxMk/s400/image5.JPG" alt="" id="BLOGGER_PHOTO_ID_5151286519391956034" border="0" /></a><br />This step can cause problems and a number of people have posted questions on the OLAP forum regarding connecting to a database instance. Using a TNSNames alias as the connection string causes the majority of problems. You can only use a TNS alias if you also install the SQL net layer from the database client CD. This is not provided as part of the AWM installation so needs to be added as part of a separate process.<br /><br />Personally I always a JDBC connection as this does require any additional software to be installed. The syntax for a jdbc connection is :<br /><br /><span style="font-size:85%;"><span style="font-family:courier new;">Hostname:port:sid</span><br /></span><br />An example would be something like this:<br /><br /><span style="font-size:85%;"><span style="font-family:courier new;">klaker-uk.uk.oracle.com:1521:beans</span></span><br /><br />Alternatively you can use localhost or 127.0.0.1 to identify the host:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwtwCIKzt6PiOCcxvj8YPgJzzsiDI8v8wIEWvWHpa2Q9H1JsG5nlPhhzJuoVCRa8pKqFCk3b0bqYuI4GQMZmImf1S8COkbifO7jSCA-EvsDCA3L3F-C7tI0zpU-VKDhh5DjqTy2vIPbK0/s1600-h/image4.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwtwCIKzt6PiOCcxvj8YPgJzzsiDI8v8wIEWvWHpa2Q9H1JsG5nlPhhzJuoVCRa8pKqFCk3b0bqYuI4GQMZmImf1S8COkbifO7jSCA-EvsDCA3L3F-C7tI0zpU-VKDhh5DjqTy2vIPbK0/s400/image4.JPG" alt="" id="BLOGGER_PHOTO_ID_5151286613881236562" border="0" /></a><br />To now connect to our database instance simply click on “+” sign next to the database name. You will notice from the picture below you can define as many connections within AWM as you need. Once the connection dialog is shown enter the username and password in the dialog box. And then click OK to start the connection process.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoaYTE8Qp2nvQJ_oDirAUBN0ljqZddpS4M-8m1dO4ro0B25Pn1DH1VrUYFJq7SgviOir56QTFbReMwfZUrForc7Dc-7O03UQju1YYUEYIkIvoo7CuadHDqD_TTuH9WwzRNVZB2X6E8xGI/s1600-h/image6.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoaYTE8Qp2nvQJ_oDirAUBN0ljqZddpS4M-8m1dO4ro0B25Pn1DH1VrUYFJq7SgviOir56QTFbReMwfZUrForc7Dc-7O03UQju1YYUEYIkIvoo7CuadHDqD_TTuH9WwzRNVZB2X6E8xGI/s400/image6.JPG" alt="" id="BLOGGER_PHOTO_ID_5151286751320190050" border="0" /></a><br /><span style="font-weight: bold;">Creating an Analytic Workspace</span><br />To create an analytic workspace, we need to perform the following steps:<br /><ol><li>Find the schema name under which you want the AW to reside, in this case our user is SH_OLAP. Expand that schema name to display the Analytic Workspaces node. </li><li>Next right-click the “Analytic Workspaces” node. This will show the “Create New Analytic Workspace” dialog box appears. </li><li>Lastly we can enter a name for our AW which in this case is SH_AW.</li></ol><br />Optionally, we can choose a tablespace where this AW is stored. By default, the default tablespace is used for the schema. This is set up by the database administrator (DBA) when the schema is created. In this case the default tablespace is SH_OLAP.<br /><br />Now we have created the AW, it appears in the navigator under the node where it is created. It is attached in read/write mode, which means that you can make changes to it.<br /><br />At this point we have two options:<br /><ul><li>Manually define our dimensions and cubes</li><li>Load a predefined model from a template</li></ul>You can create a workspace directly from a template. A template holds the definition of objects. You can use templates to create analytic workspaces, cubes, and dimensions. In this case we are going to manually define the objects within our AW.<br /><br /><a style="font-weight: bold;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixyN0HgjScGOfu1GEP4SyhfGKpMHqHUfeWN8GXyaXIO6TagCdnEHzQxxqtqJE2Ctx2YwtxNrtWFjkQpN2qrX8PdXzLPKE0IYWTPSKPy2kYtcD959aeEiWVmjZL6yBQOXpulGjp-vNilAs/s1600-h/image7.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixyN0HgjScGOfu1GEP4SyhfGKpMHqHUfeWN8GXyaXIO6TagCdnEHzQxxqtqJE2Ctx2YwtxNrtWFjkQpN2qrX8PdXzLPKE0IYWTPSKPy2kYtcD959aeEiWVmjZL6yBQOXpulGjp-vNilAs/s400/image7.JPG" alt="" id="BLOGGER_PHOTO_ID_5151287726277766258" border="0" /></a><br /><br /><span style="font-weight: bold;">Note:</span> Once we have created the AW, a table named AW$SH_OLAP is created at the database level. (The format for the naming convention is AW$aw_name, WHERE aw_name is the name that you have chosen for your AW.) This table stores all of the multidimensional objects in your AW.<br /><br /><span style="font-weight: bold;">Does Oracle OLAP Support Multiple Languages?</span><br />Yes, an AW can support multiple languages. This enables the users of your OLAP applications and tools to view the metadata and descriptive attributes in their native languages. The number and choice of languages is restricted only by the database character set and your ability to provide translated text.<br /><br />To add support for multiple languages, perform the following steps:<br /><ul><li>In the Model View navigation tree, expand the folder for the AW. </li><li>Click the Languages folder, and select the languages for the AW on</li><li>the General tabbed page.</li><li>As you create your objects, such as dimensions, levels, hierarchies, attributes, cubes, measures, calculated measures, and measure folders, open the Translations tabbed page of the property sheet. Enter the object labels and descriptions in each language. </li><li>When you map the dimensions, map the attributes to columns for each language.</li></ul><span style="font-weight: bold;">Note</span>: In this class, a single language is used, which is American, although the image shown below has multiple languages selected.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy73lid3rboSclpx4Uw4y_RtKxU45vFEKQmMiAbkRtgUuQsZPe0yB-4sGktBgJxHicrhEgk2QpXeapanAsDLyl1fg9IylmmlnKU74hweqoxbeUGVcEjFW5NlaVFzQMBipdhsTnlXyRrEI/s1600-h/image8.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy73lid3rboSclpx4Uw4y_RtKxU45vFEKQmMiAbkRtgUuQsZPe0yB-4sGktBgJxHicrhEgk2QpXeapanAsDLyl1fg9IylmmlnKU74hweqoxbeUGVcEjFW5NlaVFzQMBipdhsTnlXyRrEI/s400/image8.JPG" alt="" id="BLOGGER_PHOTO_ID_5151288426357435522" border="0" /></a><br /><span style="font-weight: bold;">Creating Dimensions</span><br />Dimensions are lists of unique values that identify and categorize data. They form the edges of measures (facts). Dimensions have structure that helps in the navigation of data and the definition of calculations. This structure includes levels, hierarchies, and attributes in the logical model. You define these supporting objects, in addition to the dimension itself, in order to have a fully functional dimension.<br /><br />Dimension Type<br />AWM provides two types of dimensions:<br /><ul><li>User Dimensions</li><li>Time Dimensions</li></ul>Most dimensions that we will create during this workshop are of the type default “User Dimension”. In the example shown below, a Time dimension is created. If you explicitly set the dimension type to “Time Dimension,” AWM automatically prepares some additional time attributes. When populated, these attributes facilitate time series calculations on the measures that share this dimension. It is recommended that all your time dimensions be created with this setting.<br /><br />Again this seems to regularly come up on the forums – you will only see the time series calculations in the Calculation Builder (See the workshop on building cubes). These calculations require two additional time based attributes to be populated – Timespan and End Date. Most customers do not have these attributes in their existing relational schemas so they need to be added. Fortunately OWB will generate an OLAP compliant time dimension. If you are not using OWB then you will need to find a different way of creating these additional attributes (there was a posting on the OLAP forum where someone actually posted all the code required to create an OLAP compliant time dimension but unfortunately I cannot find the thread now, may be someone else can locate it).<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNXH6lpuaGF3bXFCqJm4tXaI_Bt_sh9OfIKm1qE6zLs_Gvt0DHF3FoKF7l5LhPWQwXf-nSbEkN6s3Nw-1u90azHIMVOi-yqi1oA3IDooJJTpuzu_dqxqWukQ0FZVHzAUT6hfbncqWUXf8/s1600-h/image9.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNXH6lpuaGF3bXFCqJm4tXaI_Bt_sh9OfIKm1qE6zLs_Gvt0DHF3FoKF7l5LhPWQwXf-nSbEkN6s3Nw-1u90azHIMVOi-yqi1oA3IDooJJTpuzu_dqxqWukQ0FZVHzAUT6hfbncqWUXf8/s400/image9.JPG" alt="" id="BLOGGER_PHOTO_ID_5151288873034034322" border="0" /></a><br />Other Tabs<br />The Translations tabbed page enables you to provide labels in languages that your AW uses.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkr-Bdwi3JHfkrGCSNRqP-mwSFByCq5RYlbljmbd0FDXHJwup-nBNvkQ64Uamjyo1vz2G6MS68nfjV0ixL-KPciQ4THzW-Gv4YrYbr1VrWcFH8uRrf-sLa3qb4EteP09izK3jb1IhLwbw/s1600-h/image10.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkr-Bdwi3JHfkrGCSNRqP-mwSFByCq5RYlbljmbd0FDXHJwup-nBNvkQ64Uamjyo1vz2G6MS68nfjV0ixL-KPciQ4THzW-Gv4YrYbr1VrWcFH8uRrf-sLa3qb4EteP09izK3jb1IhLwbw/s400/image10.JPG" alt="" id="BLOGGER_PHOTO_ID_5151288993293118626" border="0" /></a><br />The “Implementation Details” tabbed page enables you to identify certain dimension characteristics. By default I always recommend using the Surrogate Key option as this ensures unique members are created across all the levels within a dimension.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpCZFinjUOX1M6L5ZoOEvZC4qfgSH3l1-c-YPs8oBNr1Y7TA9bI8BYCDcm2_YfDJekYTKGFlMWwe-67Xl22W1EKuBxuFY9SqzLW03DO7RzR_hTQbrJrwwrR6fSMq5A5BhfDkD_85_-z8g/s1600-h/image11.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpCZFinjUOX1M6L5ZoOEvZC4qfgSH3l1-c-YPs8oBNr1Y7TA9bI8BYCDcm2_YfDJekYTKGFlMWwe-67Xl22W1EKuBxuFY9SqzLW03DO7RzR_hTQbrJrwwrR6fSMq5A5BhfDkD_85_-z8g/s400/image11.JPG" alt="" id="BLOGGER_PHOTO_ID_5151289126437104818" border="0" /></a><br /><br />For people used to relational data models this can be quite confusing. What happens during when loading data into a dimension is all the source columns are collapsed into a single column within the AW. Therefore, across all the source columns the keys must be unique. Let’s consider an example with time:<br /><br /><span style="font-size:85%;"><span style="font-family:courier new;">YEAR_ID YEAR_DESC QUARTER_ID QUARTER_DESC MONTH_ID MONTH_DESC</span><br /><span style="font-family:courier new;">31-12-2007 Yr 2007 31-12-2007 Q4 2007 31-12-2007 December 2007</span><br /></span><br />Using this as a source table to populate our time dimension we have three keys (YEAR_ID, QUARTER_ID, MONTH_ID) that will be collapsed into a single column. It is obvious in this case the same key is used to identify three different levels within our dimension. In this case the last key that is read will win and the end result will be a single dimension member will be added to our time dimension and that member will be either a month or quarter or year (most likely a year). If we switch to using surrogate keys then three members will be added because the data load program will concatenate the level name with the source key to ensure uniqueness:<br /><ul><li>YEAR_31-12-2007</li><li>QUARTER_31-12-2007</li><li>MONTH_31-12-12007</li></ul>Simple really! But does this have any impact on the AW? In some cases ‘Yes’. I have found that it is prudent to keep your level names as short as possible. When building levels I normally assign simple level names such as L1, L2, L3 etc etc. This keeps the surrogate keys small and compact. What I found working with one customer was that the OLAP engine had certain issues when using very large (75 characters) text strings as the source key and by adding the level to start of each key as well caused data loading problems. Probably an edge case but since then I have always preferred using simple level ids.<br /><br /><span style="font-weight: bold;">Creating Levels</span><br />For business analysis, data is typically summarized at various levels. For example, our database schema, SH, contains daily snapshots from a transactional schema (OE, HR, etc). Days are thus the base level. However, in this case the decision has been take to summarize this data up to the monthly level and then add quarterly, and yearly levels.<br /><br />Levels have parent-child or one-to-many relationships, which form a hierarchy. For example, each month summarizes days, each quarter summarizes months, and each year summarizes quarters. This hierarchical structure enables analysts to detect trends at the higher levels and then drill down to the lower levels to identify factors that contributed to a trend.<br /><br />To create a level for any dimension, right-click the Level icon beneath the dimension, and then select Create Level. Fill in the name, labels, and a description. The labels can be used in reports; the description enables you to comment on the object. Repeat the process for each level in the dimension.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuDT949WjpzU94BVD83NSH8zmYWs0WM2tDvaCyNoC4leDaUCqmZy_RnPHpQTqN5icZkz99m87XG4EdXIEhcgiXuiutNA55c7ROqmLpCyO6ljDAs6X8YIXYYPRdhO4ZcFt_I9L-KwRe5vU/s1600-h/image14.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuDT949WjpzU94BVD83NSH8zmYWs0WM2tDvaCyNoC4leDaUCqmZy_RnPHpQTqN5icZkz99m87XG4EdXIEhcgiXuiutNA55c7ROqmLpCyO6ljDAs6X8YIXYYPRdhO4ZcFt_I9L-KwRe5vU/s400/image14.JPG" alt="" id="BLOGGER_PHOTO_ID_5151290870193827058" border="0" /></a><br /><br /><span style="font-weight: bold;">Creating Hierarchies</span><br />Most dimensions will have at least one hierarchy, but Oracle OLAP does also support completely flat dimensions where no hierarchy exists. Although this is rare it does occur in some cases, but it is always wise to have an “All Members” level for these types of dimensions as this will allow business users to pivot these types of dimensions out of their query by selecting that top level. Otherwise their queries will always be pinned to a single dimension member within the page dimension.<br /><br />A hierarchy defines a set of parentage relationships between all or some of a dimension's members:<br /><ul><li>Used for rollups of data.</li><li>Used for end-user navigation; e.g., drill-down.</li></ul>While multiple hierarchies are supported each member can have only one parent within each hierarchy.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVBqosfa_KYTbF7qyqCk-w2Gch-aWb0KFWqumfDqDHuAAvlPOx3hmL1xbB6aZQLORmECGP2tPz06kXqEPnXW98Du-3VzkZi3-8dOmcRivPOVajxlgeZeEUu4TzGH6KrB6zUdBnEKaDcrg/s1600-h/image15.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVBqosfa_KYTbF7qyqCk-w2Gch-aWb0KFWqumfDqDHuAAvlPOx3hmL1xbB6aZQLORmECGP2tPz06kXqEPnXW98Du-3VzkZi3-8dOmcRivPOVajxlgeZeEUu4TzGH6KrB6zUdBnEKaDcrg/s400/image15.JPG" alt="" id="BLOGGER_PHOTO_ID_5151290775704546530" border="0" /></a>Name the hierarchy. We can provide descriptive labels that can be used in reports. Select the “Set as Default Hierarchy” option if this is the only hierarchy for the dimension or if it is the hierarchy that will be used most frequently for analysis. In this case we can choose the Level Based Hierarchy option.<br /><br />Finally we can select the levels for our hierarchy. The levels are organized from the highest level of aggregation to the lowest.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoogFFsUxICZPex2-LfdJGSERs7ZHTYx05KYR_fPmgY5xjIWtRAtZogGago5LT4phhOY9Yu8BTHtIBl1mq0wlGBcoK26q0E9BsNvLYa9te6L8ZUK00y8kPf52-yyOqoN9LzHPvMI_GknE/s1600-h/image16.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoogFFsUxICZPex2-LfdJGSERs7ZHTYx05KYR_fPmgY5xjIWtRAtZogGago5LT4phhOY9Yu8BTHtIBl1mq0wlGBcoK26q0E9BsNvLYa9te6L8ZUK00y8kPf52-yyOqoN9LzHPvMI_GknE/s400/image16.JPG" alt="" id="BLOGGER_PHOTO_ID_5151290698395135186" border="0" /></a><span style="font-weight: bold;"><br />Creating Attributes</span> Attributes contain descriptive information about dimension members that are used for data selection and identification. They are used for labelling cross-tabular and graphical data displays, selecting data, organizing dimension members, and so on.<br />AWM 10g defines basic attributes automatically. For each dimension, it creates long and short description attributes. For a Time dimension, it also creates time-span and end-date attributes.<br /><br />We can easily add additional attributes, such as month number or quarter number. These additional attributes further enrich the AW. The Implementation Details tabbed page identifies the data type for the attribute. This data type should match the source data.<br /><br />For most attributes it is useful to consider creating an Index if the attribute has a reasonably low cardinality. This will improve query performance if the attribute is used as a filter within a business query. What happens under the covers is an additional dimension is created containing the members of the attribute and a relation is created to map the attribute dimension members to the base dimension members. Oracle OLAP is very efficient at using relations during queries as a way of filtering members.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbb2kfXGR7YVXHZFsUj-gUCTMoFQ4TGl5gLBz_IHYyYZxWx8hioeNAHEn_2V6iGS4r7A0JiCiYMvr4gcWxu8FNZF7Qs4DrTwf2YgcZGYF098MxeSjgcXPlmY03kZRQjwo7bBTnGvvAMgM/s1600-h/image17.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbb2kfXGR7YVXHZFsUj-gUCTMoFQ4TGl5gLBz_IHYyYZxWx8hioeNAHEn_2V6iGS4r7A0JiCiYMvr4gcWxu8FNZF7Qs4DrTwf2YgcZGYF098MxeSjgcXPlmY03kZRQjwo7bBTnGvvAMgM/s400/image17.JPG" alt="" id="BLOGGER_PHOTO_ID_5151290621085723842" border="0" /></a><br /><br />In the next posting in this series of workshops we will review how to map dimensions to source data and how to manage different types of dimensions (value based, skip level, ragged, star source table and snowflake source tables).Keith Lakerhttp://www.blogger.com/profile/01039869313455611230noreply@blogger.com5tag:blogger.com,1999:blog-3820031471524503731.post-90120867548283451392007-12-31T08:34:00.000-08:002008-12-11T15:25:56.302-08:00OLAP Workshop 2 : Understanding OLAP TechnologyIn the last posting I hopefully explained some of the basic concepts behind OLAP. In this posting I want to explore how those basic concepts are exposed by the various OLAP aware ETL and reporting tools provided by Oracle and other BI vendors.<br /><br /><span style="font-size:130%;"> <span style="font-weight: bold;">Architecture of Oracle OLAP</span></span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3JogODEwInrL8E_vzcZq8X6eIvLdaEMEGwWpifKO_i_E6El_67nTnWEpbVyCnVI46bjW91lc9CLzq7yYnVYMoHslKYcSUpRdw2xSordg79GssHnv1ypp_kt_WPH7bQNkdfe7NfXs_LPQ/s1600-h/Image1.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3JogODEwInrL8E_vzcZq8X6eIvLdaEMEGwWpifKO_i_E6El_67nTnWEpbVyCnVI46bjW91lc9CLzq7yYnVYMoHslKYcSUpRdw2xSordg79GssHnv1ypp_kt_WPH7bQNkdfe7NfXs_LPQ/s400/Image1.JPG" alt="" id="BLOGGER_PHOTO_ID_5151277628809653122" border="0" /></a><br /><br /><br />For a long time now Oracle has been unique in the marketplace. With Oracle Database 9i, 10g and 11g, all data (relational and multidimensional) is stored in one Oracle database. Only Oracle OLAP provides native multidimensional data types within the database.<br /><br />A high-level architectural view of the Oracle OLAP option contains three parts:<br /><ul><li>Oracle Database 10g OLAP option, which comprises:</li><ul><li>Multidimensional data types</li></ul><ul><li>OLAP calculation engine</li></ul><ul><li>Open-access interfaces</li></ul><li>End-user tools, which provide access to OLAP data for a wide spectrum of analytic needs </li><li>Administrative tools used to create and manage multidimensional data types. Oracle provides two administrative tools that can be used to create multidimensional data types in Oracle Database 10g:</li><ul><li>Oracle Warehouse Builder</li></ul><ul><li>Analytic Workspace Manager</li></ul></ul>The following sections examine these three layers in more detail.<br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Components of Oracle OLAP</span> </span>With the Oracle OLAP option, you get two powerful arenas of functionality:<br /><ul><li>OLAP API and the analytic workspace (AW).</li><li>OLAP API Functionality</li></ul><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_tzpyQbnzPllw1_y2j5ISHP3MbGpb8j7lRPCcNQmHg0stHAe27DgQIbRCXgZmDtWa_VwOduN_dbHqyWTy81qwbRdX6lMeZgF3WS_dodnyJP4Xhlcf5DkoLfajjClnq9wCStH3oRo6DDk/s1600-h/Image1a.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_tzpyQbnzPllw1_y2j5ISHP3MbGpb8j7lRPCcNQmHg0stHAe27DgQIbRCXgZmDtWa_VwOduN_dbHqyWTy81qwbRdX6lMeZgF3WS_dodnyJP4Xhlcf5DkoLfajjClnq9wCStH3oRo6DDk/s400/Image1a.JPG" alt="" id="BLOGGER_PHOTO_ID_5151278346069191570" border="0" /></a><br /><br /><span style="font-weight: bold;">Analytic Workspace</span><br />The Analytic Workspace is the container for the multidimensional data types and leverages the multidimensional calculation engine of the OLAP Option. The AW also provides a standard SQL interface to the multi-dimensional model. This provides an industry standard access layer that can be used by any BI reporting tool that generates SQL commands, from SQL Developer, to Application Express on to more sophisticated tools such as BI EE.<br /><br />The AW also provides an XML API for administration, and a programming language (OLAP DML).<br /><br /><span style="font-weight: bold;">Multidimensional Data Store </span><br />The OLAP option provides true array-based multidimensional data types within the Oracle database. These multidimensional data types are contained in special tables in Oracle called analytic workspaces. Some data types are used to store data, whereas others are calculated instantaneously using the multidimensional engine.<br /><br /><span style="font-weight: bold;">Multidimensional Calculation Engine</span><br />The OLAP Option’s multidimensional engine includes an impressive library of multidimensional-aware calculation functions and support for planning functionalities such as statistical forecasts, models, allocations, projections, and “what-if” scenarios, in the context of Analytic Workspaces. The multidimensional engine interacts with the multidimensional data types in the analytic workspace in the Oracle database.<br /><br />The Oracle OLAP option provides a specialized Java API that developers can use to exploit the full power of the Oracle OLAP option by using advanced dimensionally aware tools and applications. This API is used by Oracle Business Intelligence tools such as OracleBI Beans, OracleBI Discoverer, OracleBI Spreadsheet Add-In, and Oracle Reports OLAP Plug-in to provide a true multi-dimensional query and calculation environment.<br /><br /><span style="font-weight: bold;">OLAP DML</span><br />The OLAP DML is an extremely powerful and analytically rich feature of the AW. It is a dimensionally aware, high-level procedural language that runs in the database and exploits the multidimensional engine and multidimensional data types.<br /><br />With the Oracle OLAP option developers can exploit the OLAP DML to add more sophisticated calculations and analysis to AWs and to extend the functionality of applications that access them. The OLAP DML is briefly introduced in the lesson titled “Previewing Advanced Oracle OLAP Features.”<br /><br /><span style="font-weight: bold;">AW API</span><br />The AW API is a Java API that is used to define and physically build multidimensional analytic workspaces inside Oracle Database 10g. The AW API is used by administrative tools such as Analytic Workspace Manager and may be used by developers, if required, to enhance and extend analytic workspaces as necessary for a specific application.<br /><br /><span style="font-weight: bold;">Query Access to Oracle OLAP</span><br />Different users with different end-user tool requirements can all access the same data, taking advantage of the same calculations, and benefit from the same security, scalability, performance, and availability of the Oracle database.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp7CYBTjMIZ-Gqy3Mo_H-OSQ0LykLxlB_MKI-wp2ICyEGrOYgNYTMDB2LzCnZDvhSgqHUy48t371m2yUsLlegI_CxFnMJTRZidgotLkO5SMFhro-GRRDX9F8GqOMf7q-UIXBMSK5TdWK8/s1600-h/Image2.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp7CYBTjMIZ-Gqy3Mo_H-OSQ0LykLxlB_MKI-wp2ICyEGrOYgNYTMDB2LzCnZDvhSgqHUy48t371m2yUsLlegI_CxFnMJTRZidgotLkO5SMFhro-GRRDX9F8GqOMf7q-UIXBMSK5TdWK8/s400/Image2.JPG" alt="" id="BLOGGER_PHOTO_ID_5151278882940103586" border="0" /></a><br /><span style="font-weight: bold;">OLAP API</span><br />The OLAP API is designed to work with both multidimensional data types and relational data types in the Oracle database.<br /><ul><li>The API enables you to directly access multidimensional data types in the AW.</li><li>To access relational data types, you can register a relational physical dimensional model (such as a star or snowflake schema) to the Oracle Database OLAP Catalog.</li></ul>Therefore, tools that use the OLAP API can be deployed against multidimensional analytic workspaces or suitable relational schemas that are registered to the Oracle OLAP option’s metadata layer.<br /><br />Many Oracle source business intelligence tools take full advantage of the multidimensional query data model provided by the Oracle OLAP option through the OLAP API. These include OracleBI Spreadsheet Add-In, OracleBI Discoverer, OracleBI Beans, and OracleBI Reports.<br /><br /><span style="font-weight: bold;">SQL Interface</span><br />Unlike other multidimensional OLAP server products, Oracle OLAP provides not only a specialized API but also industry-standard SQL to access multidimensional data types.<br /><br />You can use a simple SQL query with relationally oriented tools and applications to gain access to the multidimensional data types in the Oracle database. As a result, your SQL-based applications (such as report generators and ad hoc query tools) can access multidimensional data and calculations managed by the Oracle OLAP option.<br />SQL and PL/SQL are also used to manage and maintain multidimensional analytic workspaces and to move data between relational and multidimensional data types within the Oracle database.<br /><br />For example, Oracle Application Express is an easy-to-use tool that is supplied with Oracle Database 10g for Web access to the Oracle database. Oracle Application Express is an example of a SQL-based application with no built-in OLAP knowledge that can nevertheless leverage the power of Oracle OLAP.<br /><br />Many third-party tools from independent software vendors and Oracle partners, such as Arcplan, Business Objects, Cognos, and a large and growing number of business intelligence vendors throughout the world, access OLAP data through the Oracle OLAP option. Some of these vendors’ tools leverage the OLAP API, whereas others exploit the SQL query interface.<br /><br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Dimensionally Aware Products</span><br /></span><br /><span style="font-weight: bold;">Oracle BI Spreadsheet Addin</span><br />OracleBI Spreadsheet Add-In makes it easy to access OLAP data through the familiar spreadsheet environment of Microsoft Excel. After installation of OracleBI Spreadsheet Add-In, “OracleBI” appears as a new menu item in Excel. By using OracleBI Spreadsheet Add-In, you can establish a secure connection to the OLAP data source and use Excel as the front-end access tool to the data in the database.<br /><br />Here are some of the features of OracleBI Spreadsheet Add-In:<br /><ul><li>It combines the flexibility and familiarity of Excel and the power, scalability, and security of the Oracle OLAP option.</li><li>OracleBI Query and Calculation Builders: After the connection is established, you can use the wizard-driven interface to drill, pivot, page through large cubes, and create reports.</li><li>Access to Excel features</li><li>Powerful data-formatting features of Excel, </li><li>Combine Oracle OLAP data with other Excel data</li><li>Write Excel macros that leverage all your data. </li><li>Create formulas and graphs in Excel,<br /></li></ul>Excel users can quickly and easily combine the powerful analytic capabilities of Oracle OLAP with standard Excel functions that you know and use each day.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6_56PZZDBBlkCaDVq4FvVUhEI9bHXNxUijJ-h5L7akExY5hTnncjVaLPWfzOS_j09ykpQn3lGr_jDHRGHX0LCxsuJ7ZNYAHNAn1tnWMozBmKzX5YzCead8AJQ3V6EN__ww2kRLsLWAx4/s1600-h/Image3.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6_56PZZDBBlkCaDVq4FvVUhEI9bHXNxUijJ-h5L7akExY5hTnncjVaLPWfzOS_j09ykpQn3lGr_jDHRGHX0LCxsuJ7ZNYAHNAn1tnWMozBmKzX5YzCead8AJQ3V6EN__ww2kRLsLWAx4/s400/Image3.JPG" alt="" id="BLOGGER_PHOTO_ID_5151279733343628210" border="0" /></a><br /><br />When using Excel OLAP calculations are performed directly in the database: The benefit of using OracleBI Spreadsheet Add-In is that you no longer need to download massive amounts of data to your spreadsheet. Oracle Database 10g OLAP performs all the OLAP calculations quickly and efficiently in the database. The calculations and business logic are defined only once in the database and then shared across the user community.<br /><br />For more information go to the Spreadsheet Addin home page on OTN:<br /><br />Spreadsheet Addin OTN Home Page<br /><a href="http://www.oracle.com/technology/products/bi/spreadsheet_addin/index.html">http://www.oracle.com/technology/products/bi/spreadsheet_addin/index.html<br /></a><br />OracleBI Spreadsheet Add-In Feature Overview<br /><a href="http://www.oracle.com/technology/products/bi/spreadsheet_addin/htdocs/feature_overview/oraclebi_spreadsheet_addin_fov.htm">http://www.oracle.com/technology/products/bi/spreadsheet_addin/htdocs/feature_overview/oraclebi_spreadsheet_addin_fov.htm<br /></a><br />Introduction to OracleBI Spreadsheet Add-In<br /><a href="http://www.oracle.com/technology/products/bi/spreadsheet_addin/viewlets/olapsa_welcome_viewlet_swf.html">http://www.oracle.com/technology/products/bi/spreadsheet_addin/viewlets/olapsa_welcome_viewlet_swf.html<br /></a><br /><br /><span style="font-weight: bold;">OracleBI Discoverer </span><br />This is another Oracle Business Intelligence tool that can directly access Oracle OLAP data. Discoverer Plus OLAP is an ad hoc query, reporting, analysis, and Web-publishing tool. It enables you to:<br /><ul><li>Perform OLAP query, reporting, and analysis on both multidimensional data models (analytic workspaces) and relational OLAP data models (star or snowflake schemas).</li><li>Access and analyze multidimensional data from your company’s database without having to understand complex database concepts. The wizards and menus of Discoverer Plus OLAP guide you through the steps to retrieve and analyze multidimensional data.</li></ul>Because Discoverer Plus OLAP understands the dimensional data model, you formulate your queries in the language of business—you use dimensions, hierarchies, levels, and measures through a simple interface. You can also exploit the rich features of OLAP through dimensionally aware query and calculation builders, thereby simplifying the tasks of defining queries and calculations. Worksheets that are authored in Discoverer Plus OLAP are published to the Web, where Discoverer Viewer and Oracle Portal users can access them.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4kd6uJNSm_bvRu7eJq55WY9O8_cyzAtbiBPwFcJwu99TYjcpkdM4R_LbOHF2AE4GQz0TD9aobWR3roDmeGr8voQhQtTtsEDQ2nexyFCuC0JLwJW_heUnLD70wiezP_Ho-x2IVGB1grXM/s1600-h/Image4.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4kd6uJNSm_bvRu7eJq55WY9O8_cyzAtbiBPwFcJwu99TYjcpkdM4R_LbOHF2AE4GQz0TD9aobWR3roDmeGr8voQhQtTtsEDQ2nexyFCuC0JLwJW_heUnLD70wiezP_Ho-x2IVGB1grXM/s400/Image4.JPG" alt="" id="BLOGGER_PHOTO_ID_5151280364703820738" border="0" /></a><br />For more information go to the Discoverer home page on OTN:<br /><br />Discoverer OTN Home Page<br /><a href="http://www.oracle.com/technology/products/discoverer/index.html">http://www.oracle.com/technology/products/discoverer/index.html<br /></a><br />Creating OLAP worksheets<br /><a href="http://www.oracle.com/technology/products/discoverer/files/viewlets/1012_plus_olap_creating.html">http://www.oracle.com/technology/products/discoverer/files/viewlets/1012_plus_olap_creating.html<br /></a><br />Modifying OLAP worksheet properties<br /><a href="http://www.oracle.com/technology/products/discoverer/files/viewlets/1012_Plus_OLAP_Modifying.html">http://www.oracle.com/technology/products/discoverer/files/viewlets/1012_Plus_OLAP_Modifying.html</a><br /><br /><span style="font-weight: bold;">OracleBI Beans</span><br />OracleBI Beans is used by business intelligence and OLAP developers. OracleBI Beans is used for developing applications such as Oracle Enterprise Planning and Budgeting and tools such as OracleBI Discoverer and OracleBI Spreadsheet Add-In. BI Beans is also available to third-party software developers to accelerate development of custom OLAP applications.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkZsS5ar1_jAjQZ9wPuAwtxQW_0GLXLVShuxVkltuDmyK1wbCTDcRhJ7pIOOFxNdMniCBxYMuaSOgcTFmxinqblQ6mp_PwBB-Y9BKOHHshXYeJN1XJPC3y5QWimxo1dWWimpDYKRz_WfM/s1600-h/Image5.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkZsS5ar1_jAjQZ9wPuAwtxQW_0GLXLVShuxVkltuDmyK1wbCTDcRhJ7pIOOFxNdMniCBxYMuaSOgcTFmxinqblQ6mp_PwBB-Y9BKOHHshXYeJN1XJPC3y5QWimxo1dWWimpDYKRz_WfM/s400/Image5.JPG" alt="" id="BLOGGER_PHOTO_ID_5151280931639503826" border="0" /></a><br /><br />BI Beans is a set of standards-based Java beans that is integrated into Oracle JDeveloper. It provides analysis-aware application building blocks designed for the Oracle OLAP option of the Oracle database. Using BI Beans, you can create customized business intelligence applications that take advantage of the robust analytic capabilities of Oracle OLAP.<br /><br />Applications can include advanced features such as interactive user interfaces, drill-to-detail reports, forecasting, and what-if analysis. BI Beans includes Java beans for acquiring data from the Oracle database, presenting data in a variety of crosstab and graph formats, and saving report definitions, custom measures, and data selections.<br />Using BI Beans, you can develop business intelligence applications from Oracle JDeveloper, or any Java application development environment, and deploy them through any application server as a thin or thick client.<br /><br />For more information go to the BI Beans home page on OTN:<br /><br />BI Beans OTN Home Page<br /><a href="http://www.oracle.com/technology/products/bib/index.html">http://www.oracle.com/technology/products/bib/index.html<br /></a><br />Oracle BI Beans Feature Overview<br /><a href="http://www.oracle.com/technology/products/bib/1012/htdocs/feature_overview/BI_Beans_Feat_Oview.htm">http://www.oracle.com/technology/products/bib/1012/htdocs/feature_overview/BI_Beans_Feat_Oview.htm<br /></a><br />Developing a Dashboard Application with Oracle BI Beans<br /><a href="http://www.oracle.com/technology/products/bib/1012/viewlets/MS%20Developing%20Executive%20Insight.html">http://www.oracle.com/technology/products/bib/1012/viewlets/MS Developing Executive Insight.html<br /></a><br /><br /><span style="font-weight: bold;font-size:130%;" >SQL Access Products<br /></span><span style="font-weight: bold;">Oracle Business Intelligence EE</span><br />Oracle Business Intelligence Suite Enterprise Edition 10g, Release 3 (BI EE 10g) delivers significant new product enhancements to further enable enterprise-wide BI, including integration with Oracle OLAP. In this release, Oracle's native multidimensional data model -- the analytic workspace (AW) -- is made accessible to BI EE 10g by creating the required metadata in Oracle BI Administration Tool. The AW data is exposed to the BI EE 10g product stack, and the OLAP engine is leveraged for analysis of that data.<br /><br />Creating access to Oracle OLAP data is a simple 3-step process. Each these steps are covered in detail as part of a training document provided as an Oracle by Example. This explains how to: prepare an AW for access by BI EE 10g; create the required metadata using Oracle BI Administration Tool; and create analytic reports of AW data using Oracle BI Answers<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdBx912W10Wc45fYW1WA0tOIK7WAgnC7m-IABwxX7ZbK3gwufAdMo0bvxk8ryUnjtzHmAhYTpiP_EOtriq2VO-OO14eJO3c-HCRJxeNaMiL9ceX8JZSNH5mX2wfq0bpKGZ3AcnktCauSM/s1600-h/Image8.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdBx912W10Wc45fYW1WA0tOIK7WAgnC7m-IABwxX7ZbK3gwufAdMo0bvxk8ryUnjtzHmAhYTpiP_EOtriq2VO-OO14eJO3c-HCRJxeNaMiL9ceX8JZSNH5mX2wfq0bpKGZ3AcnktCauSM/s400/Image8.JPG" alt="" id="BLOGGER_PHOTO_ID_5151281404085906402" border="0" /></a><br /><br />For more information go to the BI EE home page on OTN:<br /><br />BI EE OTN Home Page<br />http://www.oracle.com/technology/products/bi/enterprise-edition.html<br /><br />Ad-hoc query and reporting<br /><a href="http://www.oracle.com/technology/products/bi/enterprise-edition-platform-components.html">http://www.oracle.com/technology/products/bi/enterprise-edition-platform-components.html<br /></a><br />Oracle By Example:<br />These lessons are designed for completion in the order that is shown below. Each subsequent lesson depends on the completion of the previous lesson. Click on any of the links below to begin.<br /><br />Lesson 1: Preparing an Analytic Workspace for Access by Oracle BI EE 10g<br /><a href="http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/olap/PrepareAW.htm">http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/olap/PrepareAW.htm<br /></a><br />Lesson 2: Creating BI EE 10g Metadata for the Analytic Workspace<br /><a href="http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/olap/CreateMetadata.htm">http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/olap/CreateMetadata.htm<br /></a><br />Lesson 3: Querying OLAP Data Using Oracle BI Answers<br /><a href="http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/olap/QueryData.htm">http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/olap/QueryData.htm<br /></a><br /><br /><br /><span style="font-weight: bold;">Oracle Application Express</span><br />The Oracle OLAP option provides a SQL interface to access multidimensional data types, thus enabling any SQL-aware tool to access data in the analytic workspace.<br />Oracle Application Express is an easy-to-use report builder that is provided with Oracle Database 10g to simplify the creation of database-centric interactive Web pages.<br /><br />Thus, with the Oracle OLAP option, you can use Oracle Application Express to provide Web-based access to key performance indicators such as profitability, sales, units shipped, trends, and period-to-period comparisons and forecasts.<br />It provides support for some interactive reporting (for example, you can use hypertext links to call more SQL queries), but it is not a fully interactive analysis system like OracleBI Discoverer or like other specialized business intelligence tools.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOZRXDlEez42yosMJVAq9U1PG4O3FVvexAef1oktPTCNc1J-_GwSxp5VuM3vm-sH-AFcXzv_CT3xP4yLc7GHnitpQedMAOOmev6uQ9PlbEn2xf7NBV7mVmRdn0-fm6wl4aJzss51GDasE/s1600-h/Image6.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOZRXDlEez42yosMJVAq9U1PG4O3FVvexAef1oktPTCNc1J-_GwSxp5VuM3vm-sH-AFcXzv_CT3xP4yLc7GHnitpQedMAOOmev6uQ9PlbEn2xf7NBV7mVmRdn0-fm6wl4aJzss51GDasE/s400/Image6.JPG" alt="" id="BLOGGER_PHOTO_ID_5151281872237341682" border="0" /></a>The Web report in the slide is generated with the following SQL code:<br /><br /><span style="font-family:courier new;">SELECT region_desc, sales, units, cost, profit, </span><br /><span style="font-family:courier new;">ROUND(pct_margin ,3), fcast_sales</span><br /><span style="font-family:courier new;">FROM mysalesaw_view</span><br /><span style="font-family:courier new;">WHERE time_desc = TO_CHAR(ADD_MONTHS(SYSDATE,-3), 'Mon-YY')</span><br /><span style="font-family:courier new;"> AND product_level = ‘ALL'</span><br /><span style="font-family:courier new;"> AND channel_level = ‘ALL'</span><br /><span style="font-family:courier new;"> AND customer_level= 'REGION'</span><br /><span style="font-family:courier new;"> ORDER BY sales DESC;</span><br /><br />Because the multidimensional data model presents data to the query layer as if it were precalculated, prejoined, and preaggregated, your query does not need to perform any calculations, joins, or aggregations. SQL code is thus very simple to write and fully leverages the power of the AW. The multidimensional engine returns the requested data from the AW extremely efficiently and quickly, even if the AW is calculating much of the data instantaneously.<br /><br />For more information go to the Application Express home page on OTN:<br /><br />Application Express OTN Home Page<br /><a href="http://www.oracle.com/technology/products/database/application_express/index.html">http://www.oracle.com/technology/products/database/application_express/index.html<br /></a><br />What is Oracle APEX?<br /><a href="http://www.oracle.com/technology/products/database/application_express/html/what_is_apex.html">http://www.oracle.com/technology/products/database/application_express/html/what_is_apex.html<br /></a><br />3.0 New Features<br /><a href="http://www.oracle.com/technology/products/database/application_express/html/3.0_new_features.html">http://www.oracle.com/technology/products/database/application_express/html/3.0_new_features.html<br /></a><br /><br /><span style="font-weight: bold;font-size:130%;" >Tools to Build an Analytic Workspace</span><br />Two tools are available for IT and power users to easily build analytic workspaces (AWs) and load them with data (for analysis with tools such as OracleBI Beans, OracleBI Discoverer, and OracleBI Spreadsheet Add-In):<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMawT6CkncUX8UIm58ku22KwmeecDbS1n7OkRzzu7kf7fQGDt9OW5T-8nzYbvIVlXeE-J1auHEDClck0F5CCx4lLEbNlztILE0xlnS-K5R7oOOGETyuFSNehIbxJ_flUvooiY5N3ZPAak/s1600-h/Image7.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMawT6CkncUX8UIm58ku22KwmeecDbS1n7OkRzzu7kf7fQGDt9OW5T-8nzYbvIVlXeE-J1auHEDClck0F5CCx4lLEbNlztILE0xlnS-K5R7oOOGETyuFSNehIbxJ_flUvooiY5N3ZPAak/s400/Image7.JPG" alt="" id="BLOGGER_PHOTO_ID_5151282430583090178" border="0" /></a><br /><span style="font-weight: bold;">Shared API for AW Creation</span> Both OWB and AWM use the AW XML API to build and maintain AWs. Therefore, an AW model that is created by AWM can be incorporated back into the OWB repository to provide version control, lineage, and impact analysis if changes to the original source systems are required.<br /><br />Note: Both OWB and AWM generate scripts that may be called and scheduled from PL/SQL scripts or other scheduling processing tools, if required.<br /><br /><span style="font-weight: bold;">Analytic Workspace Manager (AWM)</span> AWM is a tool that makes it easy to build and maintain AWs from a suitable (clean) data source. AWM is used on source data that has been cleaned by the ETL process.<br /><br />The clean data may have been created by Oracle Warehouse Builder or by another ETL process; your IT department would have a preferred method of preparing data.<br />AWM is focused on the simple task of building AWs. It has an intuitive wizard-based user interface and is therefore suitable for both IT and power users.<br /><br />AWM supports the complete process of creating an AW from beginning to end in a single, dimensionally aware design environment.<br /><br />The creation process includes three easy steps:<br /><ol><li>Design the dimensional model.</li><li>Map the dimensional object to the source data.</li><li>Load the data into the AW. </li></ol>After you have performed these steps, the AW is immediately available for your tools to query.<br /><br />For more information go to the OLAP home page on OTN:<br /><br />OLAP OTN Home Page<br /><a href="http://www.oracle.com/technology/products/bi/olap/olap.html">http://www.oracle.com/technology/products/bi/olap/olap.html<br /></a><br />Analytic Workspace Manager 10.2.0.3.0A<br /><a href="http://www.oracle.com/technology/software/htdocs/devlic.html?url=http://download.oracle.com/otn/java/olap/AWM_102030A_Win32.zip">http://www.oracle.com/technology/software/htdocs/devlic.html?url=http://download.oracle.com/otn/java/olap/AWM_102030A_Win32.zip<br /></a><br />Analytic Workspace Manager 10g<br /><a href="http://www.oracle.com/technology/products/bi/olap/1451_AWM10g.pdf">http://www.oracle.com/technology/products/bi/olap/1451_AWM10g.pdf<br /></a><br />Improve SQL Based Business Intelligence Tools with Oracle OLAP 11g<br /><a href="http://www.oracle.com/technology/products/bi/olap/Oracle_OLAP_11g_TWP.pdf">http://www.oracle.com/technology/products/bi/olap/Oracle_OLAP_11g_TWP.pdf<br /></a><br />Leveraging Business Intelligence Tools<br /><a href="http://www.oracle.com/technology/products/bi/olap/40261_leveragingtools.pdf">http://www.oracle.com/technology/products/bi/olap/40261_leveragingtools.pdf<br /></a><br />Analytic Workspace Manager 10.2.0.3.0<br /><a href="http://www.oracle.com/technology/products/bi/olap/viewlet/AWM102_viewlet_swf.html">http://www.oracle.com/technology/products/bi/olap/viewlet/AWM102_viewlet_swf.html<br /></a><br /><br /><span style="font-weight: bold;">OracleBI Warehouse Builder 10g R2 (OWB)</span><br />OWB is an advanced management and ETL tool, used by developers and database administrators to build and manage data warehouses in the Oracle database. OWB manages the entire process of collecting and cleaning data.<br /><ul><li>Collecting data: OWB collects data from the various operational systems that feed the data warehouse.</li><li>Cleaning data: OWB performs various required transformations and data-cleansing activities (for example, dealing with inconsistencies between different source systems, matching and merging data from them, and processing missing or erroneous data). </li></ul>The result is a set of clean tables in the Oracle database.<br /><ul><li>OWB includes advanced data-profiling features.</li><li>OWB enables data warehouse developers to optionally populate relational star or snowflake schemas or multidimensional AWs for access by the Oracle OLAP option.</li><li>OWB is, therefore, a professional IT tool.</li></ul>Warehouse Builder is free to database customers and this free functionality includes deploying OLAP schemas. Some Warehouse Builder features are costed options and these include:<br /><ul><li>Enterprise ETL</li><li>Data Quality</li><li>CRM/ERP Connectors</li></ul>For more information go to the Warehouse Builder home page on OTN:<br /><br />OTN Home Page<br /><a href="http://www.oracle.com/technology/products/warehouse/index.html">http://www.oracle.com/technology/products/warehouse/index.html<br /></a><br />Oracle Warehouse Builder 10gR2 and Oracle OLAP<br /><a href="http://www.oracle.com/technology/products/warehouse/pdf/OWB10gR2%20and%20Oracle%20OLAP.pdf">http://www.oracle.com/technology/products/warehouse/pdf/OWB10gR2 and Oracle OLAP.pdf<br /></a><br />Benefits of a Multi-dimensional Model<br /><a href="http://www.oracle.com/technology/products/warehouse/pdf/Benefits%20of%20a%20multi-dimensional%20model.pdf">http://www.oracle.com/technology/products/warehouse/pdf/Benefits of a multi-dimensional model.pdf</a><br /><br />In the next workshop we will start to look at the process of building a new analytic workspace using Analytic Workspace Manager 10g (AWM) to perform the following tasks:<br /><ul><li>Create an analytic workspace</li><li>Define dimensions</li><li>Define cubes</li><li>Load data from source relational tables</li><li>View data</li></ul>Keith Lakerhttp://www.blogger.com/profile/01039869313455611230noreply@blogger.com0tag:blogger.com,1999:blog-3820031471524503731.post-40331260036143702242007-12-31T08:01:00.000-08:002008-12-11T15:25:59.603-08:00OLAP Workshop 1 : Basic OLAP ConceptsThis is the start of a series of postings that will aim to provide on understanding basic OLAP principles and, most importantly, how to use and get the the most from Oracle's world class OLAP option. This series of workshops will cover a lot of topics, including:<br /><ul><li>Basic OLAP concepts</li><li>Understanding the technology behind Oracle OLAP</li><li>Building an Analytic Workspace</li><li>Introduction to dimensions and cubes<br /></li><li>Advanced dimension and cube techniques<br /></li><li>How to use Custom Formulas</li><li>SQL Access to Cubes</li><li>Managing Oracle OLAP<br /></li></ul>A lot fo the content has been generated by our own consultants and from questions posted on the OTN OLAP forum. Hopefully you will find this series useful.<br /><br />Let’s start with the most obvious question<br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">What Is OLAP?</span></span><br />Online analytical processing (OLAP) is in my opinion a highly abused term that has lost much of its original meaning. In its original guise, dating from the early 1990’s, the term was used to describe a class of computer systems that were designed and optimized for analysis. This is still true of Oracle OLAP but not for many of the other proprietary solutions currently available in the marketplace.<br /><br />From my perspective OLAP is about working with data in business terms without having to understand the underlying storage mechanism and having the ability to intelligently and transparently support the many different types of business rules that always exist within an organisation. For example, a very simple and obvious example is Stock. Most query tools do not understand how to correctly analyse stock over time, it is left to the user to select the correct aggregation method.<br /><br />By using this term, it is possible to differentiate the more analytical requirements of the business analyst and senior management community from the requirements of the more general basic requirements that are easily and quickly answerd by most directly query a transaction processing (OLTP) system. OLAP has now evolved into a more generic environment that is centred around use of the term “business intelligence”. Here the emphasis is more on “online” or active access as well as being far more “analytical” in terms of the reports that are generated.<br /><br /><span style="font-weight: bold;">What do these terms, online and analytical, mean?</span><br /><span style="font-weight: bold;"><br />Online</span>: Although most OLAP tools and applications enable development of reports that can be saved and printed when not connected to live data, OLAP emphasizes live access to data rather than static reporting. Analytic queries are submitted against the database in real time, and the results are returned in real time.<br /><br /><span style="font-weight: bold;">Analytical processing</span>: This is the key concept with OLAP. End users can:<br /><ul><li>Easily navigate multidimensional data to perform unpredictable ad hoc queries and to display the results in a variety of interesting layouts</li><li>Transparently manage business rules across dimensions and cubes</li><li>Drill through levels of detail to uncover significant aspects of data</li><li>Rapidly and efficiently obtain the results of sophisticated data calculation and selection across multiple dimensions of data </li></ul><br />A standard transactional report or query might ask, “When did order 84305 ship?” This query reflects the basic mechanics of doing business. It involves simple data selection and little or no calculation processing. It can be answered directly from the transactional system, probably without impacting other operations. Every organisation needs this basic level of information.<br /><br />In contrast, OLAP systems are typically deployed to extend and enhance an organization’s ability to answer a much broader range of business questions about the data they are collecting in their transactional systems:<br /><ul><li>How do sales for our top 10 most profitable products across Europe for this quarter compare with sales a year ago?</li><li>What are the differences in the product-sales mix between the regions, relative to the global sales mix?</li><li>What are our forecast units, unit price per service, unit cost per product, sales, cost trends, and profit for the next 12 months?</li><li>In what ways does the mix vary by salesperson, and what is the relative performance of our salespeople?</li><li>What are the products making up 40% of our profit for each region over time?</li></ul>These questions are more analytical and complex, and the answer to one question often leads immediately to another question as the user follows a train of thought in researching a business problem or opportunity.<br /><br />OLAP is designed to make it easy for end users to ask these types of analytical questions without requiring:<br /><ul><li>Assistance from the IT department</li><li>Programming skills</li><li>Technical knowledge about the organization of the database</li></ul>The results of queries also need to be rapid so that the analyst’s train of thought is not interrupted and the value of the analysis is not diminished.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEpo0tBcRvgq_4c61jTFISclxteGMnsDO6k8DhmyKwpTX7YXOs3tC-EfZ14t3q6o8NJ6VWm0OJfwQEsxEpuEmS6SE2NCwbVZu3VUspUzjs_hyvPeXdaUbr2dI0kzpeLny_gTl7ea-O_JI/s1600-h/Picture+1.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEpo0tBcRvgq_4c61jTFISclxteGMnsDO6k8DhmyKwpTX7YXOs3tC-EfZ14t3q6o8NJ6VWm0OJfwQEsxEpuEmS6SE2NCwbVZu3VUspUzjs_hyvPeXdaUbr2dI0kzpeLny_gTl7ea-O_JI/s400/Picture+1.JPG" alt="" id="BLOGGER_PHOTO_ID_5150169540132186818" border="0" /></a><br /><br />A typical multidimensional business query, would be something like the following:<br /><br /><span style="font-style: italic;">For each region of the world, what was the percentage change in revenue for our top 20% products, over a rolling three-month period this year compared to the same period last year?</span><br /><br />This simple business question describes both the data that the user wants to examine and the structural form of that data. Business users typically want to answer questions that include terms such as what, where, who, and when. For example, you find the following essential questions embedded in the sample question:<br /><ul><li>What products are selling best? (“…top 20%…”)</li><li>Where are they selling? (“…each region of the world…”)</li><li>When have they performed the best? (“…percentage change in revenue…”)</li></ul>If you examine the query in detail it appears to be translate into a very complex query. When I have discussed this type of query during presentations at conferences and with customers you can always spot the DBAs because they immediately try to translate this question into a SQL statement. Of course it is possible to create a SQL query to answer this question. But lets start by breaking this query down and examining it in more detail:<br /><ul><li>There are two calculations (percentage change in revenue and rolling three-month total).</li><li>There is a ranking element (the top 20% of products).</li><li>There are aggregations (region level of the geography dimension).</li><li>There are multidimensional selections (specific products, specific time periods, and specific regions).</li><li>The result of the query is a multidimensional view of the data (perhaps as a tabular display on the screen, perhaps as a graph, or both).</li></ul>Now I think many people would agree this does in fact look like a complex query. To try and frame this within a traditional query and reporting tool would require considerable skill. And don’t forget this is the starting point for the analysis not the final result. The data returned by this query will drive other even more interesting and complex queries.<br /><br />But the complexity of this query is a technical issue rather than a business issue.<br />Therefore, a key goal of OLAP technology is to make it very easy for end users to ask such questions about their data without placing a burden on the IT department.<br /><br /><br /><span style="font-weight: bold;">How Does OLAP Make This Easy?</span><br />Business users think dimensionally. By design, OLAP technology stores, processes, and presents data in a dimensional way. The data model of OLAP systems reflects the users’ picture of their business data, making it easy to formulate queries in business terms.<br /><br />OLAP systems are optimised for fast retrieval of data for dimensional analysis.<br />We will now examine the multidimensional logical model, which serves as the basis for OLAP systems.<br /><br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">The key Objects within the OLAP Model</span></span><br />Most OLAP data models are built around two key concepts: measures and dimensions.<br /><br /><span style="font-weight: bold;">Measures</span><br />Measures represent factual data; they are sometimes called “facts.” Typical examples of measures are sales, cost, profit, and margin. Measures are organized by one or more dimensions. Many people visualize measures as being a simple cube type shape, in which the edges of the shape are the dimensions and the contents of the shape are the measure values. The image below shows a generic simple three-dimensional measure<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNHKHvcgCIYZ4Y9Nwr_TMiSsOWkXISOWXKbnUUg4bw3PMMoSp-LDozSLJ_jLlAErvhc9s58ccYY9xi20xuzO3i2o4t9-EpORvQ13wJuQqqKHd1UOMNwFcqAkbL9zr-qyxlYNLDbS1y_Co/s1600-h/picture+2.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNHKHvcgCIYZ4Y9Nwr_TMiSsOWkXISOWXKbnUUg4bw3PMMoSp-LDozSLJ_jLlAErvhc9s58ccYY9xi20xuzO3i2o4t9-EpORvQ13wJuQqqKHd1UOMNwFcqAkbL9zr-qyxlYNLDbS1y_Co/s400/picture+2.JPG" alt="" id="BLOGGER_PHOTO_ID_5150170884456950482" border="0" /></a><br /><br />Of course measures are not restricted to just three-dimensional definitions. A measure can have as many or as few dimensions as required to accurately manage the data associated with the measure. In additional Oracle’s OLAP option allows you to design and manage multiple cubes each with different dimensionality. In addition Oracle OLAP supports a number of different data types for measure such as: numeric (Oracle SQL data type), decimal, integer, text, date and boolean.<br /><br />Measures can be divided into two categories:<br /><ul><li>Stored Measures</li><li>Calculated (or derived) Measures</li></ul>Stored measures are loaded, aggregated and stored directly within the database. Alternatively, they can be derived from the results of calculations that are stored. For example a forecast could be derived from another stored measure such as revenue and the results of the forecast calculation stored in the database.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimshck4m2An7gePP3iYe5p8QenWxt4k6l8WgFnESjpOarBk8EYdjKnY6pXUP5M0llXV2cwJXpmAzHRglLQoi2W_sjeVHnoOWOAbsTWEWAPFaAO_xOSY1dcBqT41Q1GjZ2GySAuaxuFaVg/s1600-h/picture+3.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimshck4m2An7gePP3iYe5p8QenWxt4k6l8WgFnESjpOarBk8EYdjKnY6pXUP5M0llXV2cwJXpmAzHRglLQoi2W_sjeVHnoOWOAbsTWEWAPFaAO_xOSY1dcBqT41Q1GjZ2GySAuaxuFaVg/s400/picture+3.JPG" alt="" id="BLOGGER_PHOTO_ID_5150171245234203362" border="0" /></a><br />Calculated measures are measures whose values are calculated dynamically at query time. Only the calculation rule(s) is stored in the database. Common calculations include measures such as ratios, differences, moving totals, and averages. Calculations do not require disk storage space, and they do not extend the processing time required for data maintenance.<br /><br />Note: Oracle OLAP has a library of several hundred multidimensional calculation functions that can be used in calculated measures. It is even possible for expert users of Oracle OLAP to define their own functions to perform virtually any calculation.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8J97UvuXhHO1EhUAdIyB9y24sarL6s2RDUYAxlLmhsp-Nx3knaovHCImLXV-hnsNyAzIYRnbCTk32B0bqdGpSEMmvNu0wfvrGv9_H2QygisE4BnmoG-FkUU0UwSgy5z8_NevxVnDW-eI/s1600-h/picture+4.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8J97UvuXhHO1EhUAdIyB9y24sarL6s2RDUYAxlLmhsp-Nx3knaovHCImLXV-hnsNyAzIYRnbCTk32B0bqdGpSEMmvNu0wfvrGv9_H2QygisE4BnmoG-FkUU0UwSgy5z8_NevxVnDW-eI/s400/picture+4.JPG" alt="" id="BLOGGER_PHOTO_ID_5150171369788254962" border="0" /></a><br />From a business user perspective both measures appear and are used in exactly the same way and have equally as fast query access. All measures are equivalent as far as the end-user interface is concerned. However, it can be useful to at least provide them with the access to the definition of a calculated measure via a tooltip for example, just to avoid confusion.<br /><br />Below is an example of a typical report contained both stored and calculated measures. The two calculated columns are “Profit” and “Margin”. Because both types of measures are treated the same, business users can use them in queries, conditions, to drive colour coding, exception reporting etc.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD3ZXodULQ_TlIwDSZWsD_V2ix_b1wOG2VZ1YYKGBkXaDcaeoc80TWNbuZ_oFF-aRALizGKboPk027Co_tIa-EpFzXHu7PxbxBJ-LMemMinTQBu00vueR37GKSGn5_3EObp1rzP-XpwGM/s1600-h/picture+5.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD3ZXodULQ_TlIwDSZWsD_V2ix_b1wOG2VZ1YYKGBkXaDcaeoc80TWNbuZ_oFF-aRALizGKboPk027Co_tIa-EpFzXHu7PxbxBJ-LMemMinTQBu00vueR37GKSGn5_3EObp1rzP-XpwGM/s400/picture+5.JPG" alt="" id="BLOGGER_PHOTO_ID_5150171717680605954" border="0" /></a><br /><br />So what is the difference between a cube and a measure? If you have used Analytic Workspace Manager you will be familiar with the concept of a cube. This is a high level container, which is invisible to business users querying the OLAP data, for grouping together measures that share the same dimensionality. Cubes do make your life much easier in terms of being able to manage a whole group of measures collectively, store them all to an XML template, load data into a group of measures via single reference and so on.<br /><br /><br /><span style="font-weight: bold;">Dimensions</span><br />Dimensions identify and categorize the data within your measures by forming the edges of the measures. Examples of dimensions include product, geography, time, and distribution channel.<br /><br />Dimensions have three key components:<br /><ul><li>Hierarchies</li><li>Levels</li><li>Attributes</li></ul><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1k0g3PHEHp6JmuUfeBO8Ua5d-5XGB5iCg4fhqh-ViSQkPNIvY3WMS_pdoye0-mWouQS63yyfhiby6SKc5FCiFfYmhqDBtUSA3M2RS20PbtBlaqGWXfupK6Wvmq-mhKiMg6y5-OdzUbBg/s1600-h/picture+6.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1k0g3PHEHp6JmuUfeBO8Ua5d-5XGB5iCg4fhqh-ViSQkPNIvY3WMS_pdoye0-mWouQS63yyfhiby6SKc5FCiFfYmhqDBtUSA3M2RS20PbtBlaqGWXfupK6Wvmq-mhKiMg6y5-OdzUbBg/s400/picture+6.JPG" alt="" id="BLOGGER_PHOTO_ID_5150172082752826130" border="0" /></a><br />With the Oracle OLAP data model, dimensions are stored once and are used repeatedly. This allows dimensions, and their members, to be shared across measures. While dimensions form the edge of a measure, the members point to individual cells inside the multi-dimensional measure, as can be seen above.<br /><br />In the example below, there is just one Time dimension even though it appears three times. The three measures in the picture have different shapes, or dimensionality. Sales and Units are both dimensioned by the Customer, Product, and Time. Price is only dimensioned by Product and Time; it does not use the Customer dimension because the price does not vary by customer.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEholfj9bmn_ep4Wpw1nVyKzp0waVAsjvXcDwRpaqEtC1HwXjReIDiPsu6qHN-odhS24gvC8wAZT6TBUK3lTTt-uVKza-DrRFMIvW0qDy5hvKQl93FhlR-jUTOeA3oAT-Q8MWYi-VkxAP9I/s1600-h/picture+7.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEholfj9bmn_ep4Wpw1nVyKzp0waVAsjvXcDwRpaqEtC1HwXjReIDiPsu6qHN-odhS24gvC8wAZT6TBUK3lTTt-uVKza-DrRFMIvW0qDy5hvKQl93FhlR-jUTOeA3oAT-Q8MWYi-VkxAP9I/s400/picture+7.JPG" alt="" id="BLOGGER_PHOTO_ID_5150172250256550690" border="0" /></a><br /><span style="font-weight: bold;">Hierarchies</span><br />Dimension hierarchies are optional but are common in OLAP systems. A hierarchy is a logical structure that groups like members of a dimension together for the purpose of analysis. For example:<br /><ul><li>A Time dimension might have a hierarchy that describes how months are grouped together to represent a quarter and how quarters are grouped together to represent a full year.</li><li>An Organization dimension might have a hierarchy that makes it easy for you to identify the direct reports of a specific manager.</li></ul>Each dimension can have multiple hierarchies if required. For example, the time dimension can have a hierarchy that represents the Julian calendar and another hierarchy that represents a fiscal calendar.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuXfpw-OGjqr-ipLmQVwo7ewuwlaOHoimlmUEhQPYcWfpbEHtskPSIJUcheM6t9TlBLDA2ssEWW6s7Bz_vpVg32lQFaEED7yQ08Ot_5N169_JEEarhODh423df1pPZewXVhtm7AyXZUR0/s1600-h/picture+8.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuXfpw-OGjqr-ipLmQVwo7ewuwlaOHoimlmUEhQPYcWfpbEHtskPSIJUcheM6t9TlBLDA2ssEWW6s7Bz_vpVg32lQFaEED7yQ08Ot_5N169_JEEarhODh423df1pPZewXVhtm7AyXZUR0/s400/picture+8.JPG" alt="" id="BLOGGER_PHOTO_ID_5150172705523084082" border="0" /></a><br /><br /><br />A dimension’s structure is organized hierarchically based on parent-child relationships. These relationships enable:<br /><br /><ul><li>Navigation between levels: Hierarchies on dimensions enable drilling down to lower levels or navigating (rolling up) to higher levels. Drilling down on the Time dimension member “2005” will likely navigate you to the quarters Q1 2005 through Q4 2005. In a calendar year hierarchy, drilling down on Q1 2005 would navigate you to the months January 05 through March 05. These kinds of relationships make it easy for users to navigate large volumes of multidimensional data</li><li>Aggregation from child values to parent values: The parent represents the aggregation of its children. Data values at lower levels aggregate into data values at higher levels. Dimensions are structured hierarchically so that data at different levels of aggregation can be manipulated together efficiently for analysis and display. You learn about the aggregation capabilities of Oracle OLAP in the lesson titled “Applying Advanced Dimensional Design and Cube Processing Techniques.”</li><li>Allocation from parent values to child values: The reverse of aggregation is allocation and is heavily used by planning, budgeting, and similar applications. Here, the role of the hierarchy is to identify the children and descendants of particular dimension members for “top-down” allocation of budgets (among other uses)</li><li>Grouping of members for calculations: Share and index calculations take advantage of hierarchical relationships (for example, the percentage of total profit contributed by each product, or the percentage share of product revenue for a certain category, or costs as a percentage of the geographical region for a retail location)</li></ul><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlix1baTh52Yh7_pjhJ-oS4EIoEB2m0P_8B9SWnb06v4hvR2wIYGG-W_VbgR_IKJ6qBWmcOS8v6Oz5RES6HfXeSuVUxzjNN5qEXxpjtT-PruSwJ9tXsScHeXNPB7038_HaTCxGrCDrU4k/s1600-h/picture+9.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlix1baTh52Yh7_pjhJ-oS4EIoEB2m0P_8B9SWnb06v4hvR2wIYGG-W_VbgR_IKJ6qBWmcOS8v6Oz5RES6HfXeSuVUxzjNN5qEXxpjtT-PruSwJ9tXsScHeXNPB7038_HaTCxGrCDrU4k/s400/picture+9.JPG" alt="" id="BLOGGER_PHOTO_ID_5150173177969486658" border="0" /></a><br />In this example, you can do the following in the Product hierarchy:<br /><ul><li>Navigate up through each level in the hierarchy from the lowest level to the highest level</li><li>Navigate down the hierarchy from the highest level to the lowest level</li><li>Aggregate data from the lowest level (individual products) up through the hierarchy to the highest level (total product)</li></ul><br /><span style="font-weight: bold;">Levels</span><br />Each level represents a position in the hierarchy. The level above the base level contains aggregate values for the levels below it. The members at different levels have a one-to-many parent-child relationship. A hierarchy typically contains several levels, and a single level can be included in more than one hierarchy.<br /><br />If data for the Sales measure is stored at the Product level, then the higher levels of the product dimension enable the sales data to be aggregated correctly into Subcategory, Category, and All Products levels.<br /><br />If there are multiple hierarchies built over a dimension, it may be that a level would appear in more than one hierarchy or may exist in only one hierarchy.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy9-yeZk_ReuvbpX3YMmdEiyigkp57hWYt5PqjoXDClvxH_ScXIOFQ_Mk66IE4lpJd7fM53EzO2zm2_LeUvmxaa_GQgbbJAM1FjvwgiORhnMiAiBVFtTVjDFi5E9w0tYANcljuJEpQ-fg/s1600-h/picture+10.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy9-yeZk_ReuvbpX3YMmdEiyigkp57hWYt5PqjoXDClvxH_ScXIOFQ_Mk66IE4lpJd7fM53EzO2zm2_LeUvmxaa_GQgbbJAM1FjvwgiORhnMiAiBVFtTVjDFi5E9w0tYANcljuJEpQ-fg/s400/picture+10.JPG" alt="" id="BLOGGER_PHOTO_ID_5150173250983930706" border="0" /></a><br /><span style="font-weight: bold;">Types of Hierarchies</span><br />Within a multi-dimensional model there are two basic types of hierarchies:<br /><ul><li>Level Based</li><li>Value Based <br /></li></ul>Most of the hierarchies are level based, including the Product dimension hierarchy shown in the previous slide and the Time dimension hierarchy shown in this slide. In the time hierarchy example, there are Day, Month, Quarter, and Year levels in the hierarchy.<br /><br />Sales forces also generally have a level-based structure, as in the following example:<br />Representative > Area > Region > Country > Continent > World<br /><br />Other dimensions may have hierarchies that are not strictly level based. For example,<br />there is clearly a hierarchy in an organization chart, but all the direct reports of the President may not be at the same level. In the example, the two VPs (vice presidents) and the President’s Admin (administrative assistant) are all direct reports of the President but are not at the same level. The VPs are not at the Admin level, and the Admin is not at the VP level.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg92iTtnTjRhJmBrj4eqAk106tgJO-JcH6qWGoT0Gzj5tlEcnRtpGYa4ayrk5J3i4h-dsda7KhLW-ohEOZ2Z4WloMW-4p0cdQxjYrNmi41Sp0_K1ERVbHUMYeLMoaZKHUsv_Q-5GofKc98/s1600-h/picture+11.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg92iTtnTjRhJmBrj4eqAk106tgJO-JcH6qWGoT0Gzj5tlEcnRtpGYa4ayrk5J3i4h-dsda7KhLW-ohEOZ2Z4WloMW-4p0cdQxjYrNmi41Sp0_K1ERVbHUMYeLMoaZKHUsv_Q-5GofKc98/s400/picture+11.JPG" alt="" id="BLOGGER_PHOTO_ID_5150173869459221346" border="0" /></a><span style="font-weight: bold;">Attributes</span><br />Attributes provide descriptive information about the dimension members and are also useful when you are selecting dimension members for analysis:<br /><ul><li>Select the products whose colour (attribute) is “Blue.”</li><li>Select the customers who have two children. </li><li>Select the promotions that are of type “Multipack.”</li><li>Select all time periods whose description contains “January.”</li></ul>Most types of attributes are entirely optional. Oracle OLAP permits a large number of attributes to be created if required. Some attributes are valid for all the members of the dimension, regardless of level. For example, all products at all levels have a description. Others attributes are valid for certain levels or certain hierarchies only. For example, only individual product items have a colour.<br /><br /><br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJGi-GsWrUdjCPJX2M0AY66nOvYDSW9QnpUSjgxpyl9K_BNKQddwSWKs6jHKchJw_b21YWAd4kuERLqxowwNYHwlI_WYMCuMTg4IiRHted4E86Wr6ydMPEFhuoBzlmkm8Qs28IvlVjfb0/s1600-h/picture+12.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJGi-GsWrUdjCPJX2M0AY66nOvYDSW9QnpUSjgxpyl9K_BNKQddwSWKs6jHKchJw_b21YWAd4kuERLqxowwNYHwlI_WYMCuMTg4IiRHted4E86Wr6ydMPEFhuoBzlmkm8Qs28IvlVjfb0/s400/picture+12.JPG" alt="" id="BLOGGER_PHOTO_ID_5150173963948501874" border="0" /></a>In the above picture certain products are displayed together with their parent levels in the hierarchy (subcategories and categories) on the Product dimension. In addition, two sample attributes (Colour and Product Manager) are displayed for these products.<br />Other examples of typical attributes might include:<br /><ul><li>For Product dimensions: Colour, Flavour, Pack Size, Brand Manager Name, and so on</li><li>For Customer dimensions: Gender, Marital Status, Date of Birth, and other types of demographic information</li></ul><span style="font-style: italic;">Note</span>: Sometimes, attributes may also be modelled as levels in an alternate hierarchy. Consider the above example: If the business requirement was that measures should be aggregated by Product Manager (total for Bruce, John, Karl, Mary, and so on.) or by Colour (total for Blue, Green, Red, White, Yellow, and so on) and by the ability to drill down, aggregate, allocate, or calculate data based on these values, then many designers would consider creating additional hierarchies on the Product dimension for this purpose. However, many attributes have little business use as aggregates and are used simply in filtering.<br /><br />In the next workshop we will start to review some of the Oracle OLAP related technology, from design and maintenance right through to end user reporting.Keith Lakerhttp://www.blogger.com/profile/01039869313455611230noreply@blogger.com0