Two dimensions, one fact

Hello guys,
The last few hours I've been trying to solve the following issue:
I've got a small dataset which contains three different tables, two dimension tables and one fact table. The first dimension table is a calendar table (for now I will call this table D1), the second dimension table holds locations (named: D2) and the third (fact) table (named: F1) holds invoice data. What I would do normally is build the following model:
D1 -< F1 >- D2
This works fine as long as I only want to know the locations where there is invoice data, so far nothing goes wrong.
But when I want to know for each year (data coming from D1) which locations there were (coming from D2) I only get back results when there is invoice data in F1 (Off course there is a relation between D1 and D2, the column Year).
I tried to solve this by doing the following things:
- Use an alias table (of D1) joined to D2
- Use different join types - this works for the connection between F1 and D2 as long as D1 is not added to the table source
- Use different datasources in the Business Layer
- Join D1 to D2 and F1 in the Physical Layer
But so far I'm stuck with the same problem: I want to query two dimension tables without a fact table removing results when the fact table doesn't contain any data from one of the dimension tables.
Is there something I'm overlooking or am I asking something that is just not possible?
Thanks in advanced,
Dennis

Hi Dennis,
so your D2 location dimension also contains a column "Year"? Isn't this a bit strange?
Anyway.. if this is the case, then you could see table D2 as a logical fact table, with two logical dimensions: D1 and D2.
Then you can create a measure based on this new logical fact table and use it as an implicit fact in your subject area. By doing this, the BI Server will use table D2 to join D1 and D2 instead of the invoice fact table.
Regards,
Stijn

Similar Messages

  • Not exists / union - two dimensions nothing in the fact folder, possible???

    What I am trying to do is (in functional terms) produce an invoices on hold report.
    This has two distinct characteristics - some invoices are coding but on hold (easy - see first part of the SQL below), but some invoices have no coding, nothing in the FACT folder and I need to show two dimension folders which currently only join via the FACT folder - is this possible??
    equivalent SQL =>
    select supp.supplier_name, inv.invoice_number, inv.invoice_amount, dis.amount, code.segment1||'/||code.segment2
    from     AP_INVOICES_MV inv
    ,          ap_suppliers_mv supp
    ,       ap_holds_mv hold
    ,      AP_INVOICE_DISTRIBUTIONS dis
    ,     gl_coding code
    where inv.invoice_key = hold.invoice_key
    and    inv.supplier_key = supp.supplier_key
    and  inv.invoice_id = dis.invoice_id
    and   dis.code_key = code.code_key
    and   hold.holds <> 'No Holds'
    union
    select supp.supplier_name, inv.invoice_number, inv.invoice_amount, 0 amount, 'XXXXX/XXXX' gl_code
    from     AP_INVOICES_MV inv
    ,          ap_suppliers_mv supp
    ,       ap_holds_mv hold
    where inv.invoice_key = hold.invoice_key
    and    inv.supplier_key = supp.supplier_key
    and   hold.holds <> 'No Holds'
    and   not exists
    (select 'x'
    from    ap_invoice_distributions dis
    where dis.invoice_id = inv.invoice_id)
    order by 1, 2, 4 ascMy problems are; -
    1. is that the second part of the union (not exists section) requires me to join two DIMENSION tables without going via the FACT table is this possible?? (If so how - what JOINS would I need on between the FACT and the DIMENSIONS and would this significantly impede running speed generally)
    2. Given that even when writing direct database requests the FROM part of the SQL is the subject area, not the tables, the tool writes the joins for you, how can I write the equivalent of the above??
    n.b.
    AP_INVOICES_MV - DIMENSION
    ap_suppliers_mv - DIMENSION
    ap_holds_mv - DIMENSION
    gl_coding code - DIMENSION
    AP_INVOICE_DISTRIBUTIONS FACT
    With the structure following the classic STAR with all folders described in the dimensions equi joining to the FACT folder, BUT some in the invoices dimension will not have corresponding values in the FACT folder (un-coded invoices).
    With thanks for your input,
    Robert.

    Try this app: http://tyorex.com/iWorkConverter
    Batch convert Pages files to doc and pdf.

  • Selecting one dimension of a two dimension array?

    hi, i want to select only one dimension of an array and put it into an arraylist (or casting the array verbatim into the arraylist)
    for example, here is an two dimension array:
    Object[][] data =
         {  { new Date(), "A", new Integer(1), Boolean.TRUE },
         { new Date(), "B", new Integer(2), Boolean.FALSE },
         { new Date(), "C", new Integer(9), Boolean.TRUE },
         { new Date(), "D", new Integer(4), Boolean.FALSE}
         };and i want to cast it into an arraylist, what i have in mind (a bit troublesome is the following:)
    ArrayList dataArray = new ArrayList();
    dataArray.add(data[0]);
    dataArray.add(data[1]);
    dataArray.add(data[2]);
    dataArray.add(data[3]);
    System.out.println(dataArray);when come upon the last System.out.println, i got some seemly useless addresses:
    [[Ljava.lang.Object;@f73c1, [Ljava.lang.Object;@789144, [Ljava.lang.Object;@1893efe, [Ljava.lang.Object;@186c6b2]
    how do you accomplish casting a two dimension array into an arraylist, but the second dimension of the arraylist is kept as Array of Objects? thanks alot!

    First, the strings that are printed out are the value of the hashcode for the specific object. That is the default value that is printed out for any object reference in a class that inherits the toString() method from the Object class. This is true for arrays. Your ArrayList contains array references in it..
    So, you are printing the object hashcodes for the arrays in your ArrayList, instead of the contents of those arrays. It would be better if you created ArrayLists, or even designed an object that stores your data, and stored those inside your ArrayList. ArrayList has an overwritten toString() method that will print the contents instead of the object hashcode, so an ArrayList containing ArrayLists would print your data the way you want. If you define your own class, you will need to provide a toString() method that prints the contents the way you want.
    PS, look at http://java.sun.com/j2se/1.5.0/docs/api/java/util/AbstractCollection.html#toString() for more information on the toString() method used by ArrayList.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to contact  two dimension change to one dimension form bw query

    I had two dimension: Index and Company, Now ,I think to unite one dimension Index_Company.
    I use bw query.
    Index Company
    1        1000    
    2        3000    
    3        6000     
    4        2000      
    Return value:
    Index Company Index_Company
    1        1000       1_1000
    2        3000       2_3000
    3        6000       3_6000
    4        2000       4_2000
    I use:
    <EXPRESSION>[DEFECT1].[LEVEL01]&'_' &[ZINDEX].[LEVEL01])</EXPRESSION>
    or <EXPRESSION>[DEFECT1].[LEVEL01]+'_' +[ZINDEX].[LEVEL01])</EXPRESSION>
    Can't ok.
    I use MDXTEST tcode for BW  to test. I can't find contact  function.
    Thank you.
    Regards,
    Howard.

    For the time being there no support for string concatenation directly at MDX level. I would suggest to try this in the WebI report itself.
    Regards,
    Stratos

  • How to join Dimensions and Fact Tables in OBIEE

    Hi All,
    I need to create report which need to get the information from two fact tables and 7 dimensions. The granularity is not same in both the fact tables. One fact table is having common keys between all the dimension tables and second fact table have only two dimension keys but with different names. My requirement is to create the report by taking the measures from both the fact tables.
    I have created joins between the second fact table and two dimension tables in physical and BMM layer and also set the highest level for all other dimension tables in the LTS of second fact table. when am creating report by taking the measures from both the fact tables, data is not getting for the measure which taken from the second fact table. Please advice me how to get the data for the measure which taken from the second fact table.
    Thanks in Advancec !!

    You have to use the level-base measure capabilities.
    http://gerardnico.com/wiki/dat/obiee/bi_server/design/fact_table/level_based_measure_calculations
    For all measures of the second fact table with the lowest grain (with two dimension keys), set for all dimension where you don't have any key the logical level to the "All" or "Total".
    And UNSET the highest level of the LTS for the second fact table.
    Success
    Nico

  • Many to Many relationship betwee dimension and fact tanle

    Hello Gurus,
    I have a little question about many to many realtionship between fact and dimension table. The situation is as follows.
    Consider there is a fact table F1 and two dimension tables D1 and D2. D1 is joined to F1 with 1 to many relationship. D1 is joined to D2 with again one to many relationship ( Note: D1:D2 = 1:N and D1:F1 = 1:N). I am able to model this by merging D1 and D2 into one dimension table in BMM layer by adding them as logical table sources and creating logical table source join. I have built simple reports and the data returnned is fine. However, I would just like to know what could be the drawbacks of such a model.
    We have many other dimesions joined to the fact table and users have access to the answers that means they would could what ever report they feel like. Hence, would just like to know in what cases this model could break which means reports would give wrong data because of a many to many relationship between one of the fact and dimension table.
    Thanks in advance.

    Hello Copter,
    Even I had modeled it by reading this link before. In the situation explained by me dimension D1 is doing the job of table Rules ( as explained in link). The model is fine.
    However, my point is to undersatnd in which scenerios this model will break. As already explained, the fact table is joined to various other dimensions, there could be situations in which users select columns from various dimensions and facts randomly.
    Hence, which are the scenerios where I might get erroneous counts of meassures. Further, if someone feels this model is correct and would not break in any scenerio then please reply.

  • Common diemsions and more then one fact table join problem

    Hi,
    I have 5 common dimension and 3 fact table which in the same subject area. When I want to display results from more then one fact table sending database then query more then one and I think BI server join this two different result on OBI server. But I think if obi server sending database query for exp. WITH SAWITH0 .... the results get effective.
    +++002002:2ea0000:2ea000f:----2009/03/14 10:12:59
    -------------------- SQL Request:
    SET VARIABLE QUERY_SRC_CD='Report';SELECT "- Common Dimensions"."Year Month" saw_0, "- Subs. Tariff"."Subscriber Current Tariff Type" saw_1, "- Common Measures".Arpu saw_2, "- Common Measures"."Gross Margin" saw_3, "- Call Out"."Callout Dur" saw_4, "- Case".Case_Info_Num saw_5 FROM "CUSTOMER PROFILING" WHERE ("- Common Dimensions"."Year Month" = 200901) AND ("- Subs. Tariff"."Subscriber Current Tariff Type" = 'PREPAID') ORDER BY saw_0, saw_1
    +++002002:2ea0000:2ea000f:----2009/03/14 10:12:59
    -------------------- General Query Info:
    Repository: Star, Subject Area: CUSTOMER PROFILING REV, Presentation: CUSTOMER PROFILING
    +++002002:2ea0000:2ea000f:----2009/03/14 10:13:00
    -------------------- Sending query to database named CENTRAVEA (id: <<471777>>):
    select T223282.DIM_TIME_MONTH_ID as c1,
    T221204.DIM_SUBS_CURRENT_TARIFF_TYPE as c2,
    avg(T223490.FACT_CP_ARPU) as c3,
    sum(T223490.FACT_CP_GROSS_MARGIN) as c4,
    sum(T223490.FACT_CP_CO_DUR) as c5
    from
    DM.DIM_SUBSCRIBER T221204 /* A_DIM_SUBSCRIBER */ ,
    DM.DIM_TIME_MONTH T223282 /* A_DIM_TIME_MONTH */ ,
    DM.FACT_CUST_PROFILING_PART3 T223490 /* A_FACT_CUST_PROFILING_PART3 */
    where ( T221204.DIM_SUBS_ID = T223490.DIM_SUBS_ID and T221204.DIM_SUBS_CURRENT_TARIFF_TYPE = 'PREPAID' and T223282.DIM_TIME_MONTH_ID = T223490.DIM_TIME_MONTH_ID and T223282.DIM_TIME_MONTH_ID = 200901 and T223490.DIM_TIME_MONTH_ID = 200901 )
    group by T221204.DIM_SUBS_CURRENT_TARIFF_TYPE, T223282.DIM_TIME_MONTH_ID
    order by c1, c2
    +++002002:2ea0000:2ea000f:----2009/03/14 10:13:00
    -------------------- Sending query to database named CENTRAVEA (id: <<471881>>):
    select T223282.DIM_TIME_MONTH_ID as c1,
    T221204.DIM_SUBS_CURRENT_TARIFF_TYPE as c2,
    sum(T223294.FACT_CP_CASE_INFO_NO) as c3
    from
    DM.DIM_SUBSCRIBER T221204 /* A_DIM_SUBSCRIBER */ ,
    DM.DIM_TIME_MONTH T223282 /* A_DIM_TIME_MONTH */ ,
    DM.FACT_CUST_PROFILING_PART1 T223294 /* A_FACT_CUST_PROFILING_PART1 */
    where ( T221204.DIM_SUBS_ID = T223294.DIM_SUBS_ID and T221204.DIM_SUBS_CURRENT_TARIFF_TYPE = 'PREPAID' and T223282.DIM_TIME_MONTH_ID = T223294.DIM_TIME_MONTH_ID and T223282.DIM_TIME_MONTH_ID = 200901 and T223294.DIM_TIME_MONTH_ID = 200901 )
    group by T221204.DIM_SUBS_CURRENT_TARIFF_TYPE, T223282.DIM_TIME_MONTH_ID
    order by c1, c2
    I have another subject area and which defined like this subject area contain two dimension and 5 fact table. If I want to display results on this subject area I can see best sql for my database
    My problem is why this two different subject areas create different queries. I think following query is the best for database.
    Thanks for your help
    +++002002:2ea0000:2ea0015:----2009/03/14 10:30:06
    -------------------- SQL Request:
    SET VARIABLE QUERY_SRC_CD='Report';SELECT "Dim - Segments"."Marketing Segment" saw_0, "Fact - Campaign Response"."Fact Campaign Award Amount" saw_1, "Fact - Customer Interaction"."Issue Response Cost" saw_2 FROM "AVEA ALL" ORDER BY saw_0
    +++002002:2ea0000:2ea0015:----2009/03/14 10:30:06
    -------------------- General Query Info:
    Repository: Star, Subject Area: AVEA ALL, Presentation: AVEA ALL
    +++002002:2ea0000:2ea0015:----2009/03/14 10:30:06
    -------------------- Sending query to database named AVEA ALL (id: <<474694>>):
    WITH
    SAWITH0 AS (select sum(T51461.FACT_CMPGN_AWARD_AMOUNT) as c1,
    T49384.DIM_MARKETING_SGMNT_DESC as c2
    from
    DM.DIM_MARKETING_SEGMENT T49384 /* DIM_BI_MARKETING_SEGMENT */ ,
    DM.FACT_CMPGN_RESPONSE T51461 /* FACT_BI_CMPGN_RESPONSE */
    where ( T49384.DIM_MARKETING_SGMNT_ID = T51461.DIM_MARKETING_SGMNT_ID )
    group by T49384.DIM_MARKETING_SGMNT_DESC),
    SAWITH1 AS (select sum(T51503.FACT_CUST_INT_ISSUE_RES_COST) as c1,
    T49384.DIM_MARKETING_SGMNT_DESC as c2
    from
    DM.DIM_MARKETING_SEGMENT T49384 /* DIM_BI_MARKETING_SEGMENT */ ,
    DM.FACT_CUST_INTERACTN T51503 /* FACT_BI_CUST_INTERACTN */
    where ( T49384.DIM_MARKETING_SGMNT_ID = T51503.DIM_MARKETING_SGMNT_ID )
    group by T49384.DIM_MARKETING_SGMNT_DESC)
    select distinct case when SAWITH0.c2 is not null then SAWITH0.c2 when SAWITH1.c2 is not null then SAWITH1.c2 end as c1,
    SAWITH0.c1 as c2,
    SAWITH1.c1 as c3
    from
    SAWITH0 full outer join SAWITH1 On SAWITH0.c2 = SAWITH1.c2
    order by c1

    I find solution on Oracle® Business Intelligence Suite Enterprise Edition Release Notes.
    If you use a version of Oracle Database 10g Release 2 prior to 10.2.0.3, then you might encounter an issue with a Full Outer Join that causes severe database performance issues and appears to hang the database when the Oracle BI Server sends to the database SQL queries that include WITH clauses.
    To work around this issue when using Oracle Database 10g Release 1 or 2, upgrade to Oracle Database 10g Release 2 Patch Set 2 (for 10.2.0.3). For performance reasons, this is the preferred workaround.
    To work around this issue without installing Patch Set 2, modify the Database Features table using the Administration Tool. This configuration prevents the Oracle BI Server from sending SQL constructs that expose the issue in an unpatched Oracle Database 10g.
    To modify the Database Features table:
    In the Administration Tool, open the properties of the Physical Database metadata object.
    Navigate to the Features tab.
    Ensure the values for the PERF_PREFER_MINIMAL_WITH_USAGE and PERF_PREFER_INTERNAL_STITCH_JOIN entries are selected, that is, set to True.

  • Dimension or fact value

    Scenario:
    Got two dimension (time and organization) linked to a fact table with sickniss facts by persons.
    Now i want to add the info 'age class' (like 10-20 year, 21 -30 year.... )
    Where to add the new info? Into the fact table or crate a new dimension with one level? I think is must been a new dimension cause, i use it to group the data in the fact table and i won't use it to count the 'age class'. An the other side a one level dimension looks a little bit 'stupid'.
    Am i right?
    Hope to hear some ideas..... tnx in advanced.

    I'd probably, split "Person" out to a dimension and make AGE_GRP an attribute therof (and a type-II change triggering attribute to boot), or a separate dimension.
    I can forsee lots of other person-related attributes being things that you might eventually want to filter disease facts on (age / gender / height / weight / ethnicity / job / etc).
    Mike

  • Saving two dimensions od image for web

    Hi there,
    I have made script (with your help ) to export images for web with dimensions 300x300 px. Now I want that my script do one more resize of that files so that i get two files one 300x300 and another 66x66 px. I will post my script and ask you to hel me find the bug
    And one more question. My script exports file name + jpg but it also keeps orginal extension so I get ie. FileName.psd.jpg
    can you help me fixing this in my script... else is fine...
    thank you,
    Voah
    Edit:
    In the meen time I managed to resolve the problem so here is the new script
    But I have one more thing I would like to do. I have to manually make folder "300x300 and "66x66" or my script stops. How coud I make that script make that folders? (under inputFolder/300x300/ and inputFolder/66x66/)
    // Save current dialog preferences
    var startDisplayDialogs = app.displayDialogs;    
    // Save current unit preferences
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    var inputFolder = Folder.selectDialog("Select the input folder");
    //var outputFolder = Folder.selectDialog("Select the output folder");
    ProcessImages();
    function ProcessImages() {
      var filesOpened = 0;
    //   if ( inputFolder == null || outputFolder == null)
         if ( inputFolder == null) {
                alert("No source folder selected");
    //     if ( outputFolder == null) {
    //       alert("No output folder selected");
    //else{
      var fileList = inputFolder.getFiles();
      for ( var i = 0; i < fileList.length; i++ ) {
           if ( fileList[i] instanceof File && ! fileList[i].hidden) {
                     open( fileList[i] );
                     ResizeImage();
                     filesOpened++;
      return filesOpened;
    function ExportPng(filePrefix, fileSuffix){
    try
    var docRef = app.activeDocument;
    var docName = app.activeDocument.name.slice(0,-4);
    var saveOptions = new ExportOptionsSaveForWeb();
    saveOptions.quality = 70;
    saveOptions.format = SaveDocumentType.JPEG;
    saveOptions.optimized = true;
    docRef.exportDocument(File(app.activeDocument.path+'/300x300//'+docName+'.jpg'), ExportType.SAVEFORWEB, saveOptions);
    catch (e)
    alert("Error encountered when attempting to save the image. \r\r" + e);
    return;
    // funkcija export 2
    function ExportPng2(filePrefix, fileSuffix){
    try
    var docRef = app.activeDocument;
    var docName = app.activeDocument.name.slice(0,-4);
    var saveOptions = new ExportOptionsSaveForWeb();
    saveOptions.quality = 70;
    saveOptions.format = SaveDocumentType.JPEG;
    saveOptions.optimized = true;
    docRef.exportDocument(File(app.activeDocument.path+'/66x66//'+docName+'.jpg'), ExportType.SAVEFORWEB, saveOptions);
    catch (e)
    alert("Error encountered when attempting to save the image. \r\r" + e);
    return;
    function ResizeImage()
    if (app.documents.length > 0) {
        var docRef = app.activeDocument;
        var n = docRef.pathItems.length;
            if((n>0)&&(docRef.pathItems[0].name!="Work path" ))  {
                 docRef.pathItems[0].makeSelection();
                 docRef.selection.invert();
                 docRef.selection.clear();
                 docRef.selection.deselect();
       function fitImage() {
    var docRef = app.activeDocument;
    docRef.trim()
    var docWidth = docRef.width.as("px");
    var docHeight = docRef.height.as("px");       
    if (docWidth / docHeight > 4.8)
        docRef.rotateCanvas (315)
        docRef.trim()
    else if (docHeight / docWidth > 4.8)
        docRef.rotateCanvas(45)
        docRef.trim()
    if (docWidth < docHeight)
              docRef.resizeImage(undefined, UnitValue(270,"px"), 72,  ResampleMethod.BICUBIC )
          else if (docWidth > docHeight)
                          docRef.resizeImage(UnitValue(270,"px"),undefined, 72,  ResampleMethod.BICUBIC )
          else if (docWidth == docHeight)
                    docRef.resizeImage(UnitValue(270,"px"),UnitValue(270,"px"), 72,  ResampleMethod.BICUBIC )
    docWidth = docRef.width.as("px");
    docHeight = docRef.height.as("px");       
    if (docWidth < docHeight)
                        docRef.resizeCanvas(UnitValue(300,"px"), UnitValue(300,"px"), AnchorPosition.MIDDLECENTER);
          else if (docWidth > docHeight)
                docRef.resizeCanvas(UnitValue(300,"px"), UnitValue(300,"px"), AnchorPosition.MIDDLECENTER);
          else if (docWidth == docHeight)
                docRef.resizeCanvas(UnitValue(300,"px"), UnitValue(300,"px"), AnchorPosition.MIDDLECENTER);
    var docRef = app.activeDocument;
    var savedState = docRef.activeHistoryState;
    fitImage();
    app.displayDialogs = DialogModes.NO;
    ExportPng( File( "",".jpg" ))
    docRef.resizeImage(UnitValue(66,"px"),UnitValue(66,"px"), 72,  ResampleMethod.BICUBIC );
                ExportPng2( File( "",".jpg" ))
    docRef.close(SaveOptions.DONOTSAVECHANGES);
    docRef = null;
    // Reset app preferences
    app.displayDialogs = startDisplayDialogs;
    preferences.rulerUnits = originalRulerUnits;

    Does this help?
    main();
    function main(){
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    var inputFolder = Folder.selectDialog("Select the input folder");
    if(inputFolder == null) return;
    var fileList = inputFolder.getFiles(/\.(jpg|tif|psd|png)$/i);
    var outputFolder1 = Folder(inputFolder + "/300x300");
    if(!outputFolder1.exists) outputFolder1.create();
    var outputFolder2 = Folder(inputFolder + "/66x66");
    if(!outputFolder2.exists) outputFolder2.create();
    for (var a in fileList){
    open(fileList[a]);
    var Name = decodeURI(activeDocument.name).replace(/\.[^\.]+$/, '');
    app.activeDocument.trim(TrimType.TRANSPARENT);
    FitImage(300,300);
    var saveFile = File(outputFolder1 + "/" + Name + ".jpg");
    SaveForWeb(saveFile,70);
    FitImage(66,66);
    var saveFile = File(outputFolder2 + "/" + Name + ".jpg");
    SaveForWeb(saveFile,70);
    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
    preferences.rulerUnits = originalRulerUnits;
    function FitImage( inWidth, inHeight ) {
    var desc = new ActionDescriptor();
    var unitPixels = charIDToTypeID( '#Pxl' );
    desc.putUnitDouble( charIDToTypeID( 'Wdth' ), unitPixels, inWidth );
    desc.putUnitDouble( charIDToTypeID( 'Hght' ), unitPixels, inHeight );
    var runtimeEventID = stringIDToTypeID( "3caa3434-cb67-11d1-bc43-0060b0a13dc4" );
    executeAction( runtimeEventID, desc, DialogModes.NO );
    function SaveForWeb(saveFile,jpegQuality) {
    var sfwOptions = new ExportOptionsSaveForWeb();
       sfwOptions.format = SaveDocumentType.JPEG;
       sfwOptions.includeProfile = false;
       sfwOptions.interlaced = 0;
       sfwOptions.optimized = true;
       sfwOptions.quality = jpegQuality;
    activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

  • In Top 10 with two dimension i need to add others in my MDX query

    Hi this is code working fine and return top 2  product in a  state. i need to add other sales also how can we do
    with set FIPS as [Geography].[State-Province].[State-Province]
    set TCat as
    Generate( {FIPS}, CrossJoin( {[Geography].[State-Province].CurrentMember},
    TOPCount(
             ([Product].[Subcategory].[Subcategory]),
             2,
             [Measures].[Sales Amount]
    SELECT { [Measures].[Sales Amount] } ON COLUMNS,
    TCat  ON ROWS
    FROM [Adventure Works]
    hi fond one code it is work for one dimension only, i need for two dimension
    WITH
    SET [TCat] AS
    TopCount([Product].[Subcategory].[Subcategory],10,[Measures].[Sales Amount])
    MEMBER [Product].[Subcategory].[Other] AS
    Aggregate([Product].[Subcategory].[Subcategory] - TCat)
    SELECT { [Measures].[Sales Amount] } ON COLUMNS,
    TCat + [Other] ON ROWS
    FROM [Adventure Works]

    Hi,
    We will have to generate a set of tuples that includes both dimensions:
    WITH
    SET [Top2] AS
    Generate
    {[Customer].[State-Province].[State-Province].MEMBERS}
    [Customer].[State-Province].CurrentMember
    ,TopCount
    (EXISTING
    [Product].[Subcategory].[Subcategory].MEMBERS)
    ,2
    ,[Measures].[Internet Sales Amount]
    MEMBER [Product].[Subcategory].[All].[top2Aggr] AS
    Aggregate((EXISTING [Top2]))
    MEMBER [Product].[Subcategory].[All].[all Subcat] AS
    [Product].[Subcategory].[All]
    MEMBER [Product].[Subcategory].[All].[others] AS
    Aggregate
    (EXISTING
    [Customer].[State-Province].CurrentMember
    ,[Product].[Subcategory].[Subcategory].MEMBERS
    [Top2])
    SELECT
    {[Measures].[Internet Sales Amount]} ON COLUMNS
    [Customer].[State-Province].[State-Province].MEMBERS
    [Product].[Subcategory].[top2Aggr]
    ,[Product].[Subcategory].[others]
    ,[Product].[Subcategory].[all Subcat]
    } ON ROWS
    FROM [Adventure Works];
    If you plan to tweek this solution, you may want to align the dimensionality of the [all Subcat] member with the others members by changing its definition:
    MEMBER [Product].[Subcategory].[All].[all Subcat] AS
    aggregate(EXISTING
    [Customer].[State-Province].CurrentMember
    ,[Product].[Subcategory].[All]
    The former defintion also works in our case because it's a singleton set and it is put in a tuple when crossjoined with the axis 1 giving it the right dimensionality.
    Philip,

  • Dimension and fact table with a fact table between them

    Hello all,
    Here is my problem. As seen in the image, I have a fact table linked to the two dimensions.
    I would have the number of Id from Cube_Requirements by variant including 'unknown" variant if no linked variant.
    How is it possible ? How to create the dimension ? As my fact table has two fields, if i want to use reference as dimension usage, it doesn't work.
    Thanks for your help.

    Hi, this looks a many to many relationship scenario, follow these steps:
    - drag extractid from cube_applicability onto measures area, so this table becomes a fact
    - you will have count of Extractid measure after you perform above step
    - Assuming Variant is already a dimension, go into dimension usage tab, link variant dimension with cube_requirement fact using many to many relationship and selecting cube_applicability
    process cube, you should be able to get count of id by dragging and dropiping id from variant dimension..
    Regards
    Rakesh

  • MaxL / INCBUILDDIM - two dimension limit

    I'm trying to build multiple dimensions in a single MaxL 'import database dimensions' command by including multiple 'from xx using rules_file xx' blocks separated by commas. This syntax is as per the documentation.The reason for building multiple dimensions in a single 'import database dimensions' command, rather than using multiple commands is that this achieves the same effect as the ESSCMD 'INCBUILDDIM', where the database is only restructured after ALL the dimensions have been built.MaxL doesn't error, but it only builds the first two dimensions specified and simply ignores any others! Has anyone seen this issue - I'm wondering if it's a MaxL bug (v6.5.1). I've tried different dimensions, changing the order etc. Always the same - builds the first two, ignores anything else.Thanks..

    Assuming that your AW was defined using AWM or OWB (i.e. it is standard form), then you should find two additional objects related to your dimension -- the INHIER valueset and the HIERLIST dimension. For example, if your dimension is named PRODUCT, then you should find
    DEFINE PRODUCT_HIERLIST DIMENSION READONLY LOCKDFN TEXT
    DEFINE PRODUCT_INHIER VALUESET READONLY LOCKDFN PRODUCT <PRODUCT_HIERLIST>
    (These are 11g definitions -- the 10g versions do not have READONLY LOCKDFN.
    The PRODUCT_HIERLIST contains one member for each hierarchy of the dimension, 'H1' and 'H2' say. To limit the dimension to just members in H2 you can say
    LIMIT PRODUCT TO PRODUCT_INHIER(PRODUCT_HIERLIST 'H2')

  • Load data from dimensions to fact table

    Hi,
    I have 10 dimension tables and one fact table. now i want to load data in to fact table from dimensions table. how i can do that.
    Regards,
    joy

    To elaborate on "Mallee"'s answer, it's not good practice to load dimensional data into a fact table.
    I guess what you mean is how to refer to dimensions when loading a fact table.
    Simply refer to dimensions using lookups on the necessary dimensions, the lookup needs to be on the natural key you have that links facts to dimensions. Don't forget to use the dimension's surrogate key though when populating the fact table's foreign key columns pointing at the dimensions.
    Hope this helps.
    Cheers, Patrick

  • Foreign keys in SCD2 dimensions and fact tables in data warehouse

    Hello.
    I have datawarehouse in snowflake schema. All dimensions are SCD2, the columns are like that:
    ID (PK) SID NAME ... START_DATE END_DATE IS_ACTUAL
    1 1 XXX 01.01.2000 01.01.2002 0
    2 1 YYX 02.01.2002 01.01.2004 1
    3 2 SYX 02.01.2002 1
    4 3 AYX 02.01.2002 01.01.2004 0
    5 3 YYZ 02.01.2004 1
    On this table there are relations from other dimension and fact table.
    Need I create foreign keys for relation?
    And if I do, on what columns? SID (serial ID) is not unique. If I create on ID, I have to get SID and actual row in any query.

    >
    I have datawarehouse in snowflake schema. All dimensions are SCD2, the columns are like that:
    ID (PK) SID NAME ... START_DATE END_DATE IS_ACTUAL
    1 1 XXX 01.01.2000 01.01.2002 0
    2 1 YYX 02.01.2002 01.01.2004 1
    3 2 SYX 02.01.2002 1
    4 3 AYX 02.01.2002 01.01.2004 0
    5 3 YYZ 02.01.2004 1
    On this table there are relations from other dimension and fact table.
    Need I create foreign keys for relation?
    >
    Are you still designing your system? Why did you choose NOT to use a Star schema? Star schema's are simpler and have some performance benefits over snowflakes. Although there may be some data redundancy that is usually not an issue for data warehouse systems since any DML is usually well-managed and normalization is often sacrificed for better performance.
    Only YOU can determine what foreign keys you need. Generally you will create foreign keys between any child table and its parent table and those need to be created on a primary key or unique key value.
    >
    And if I do, on what columns? SID (serial ID) is not unique. If I create on ID, I have to get SID and actual row in any query.
    >
    I have no idea what that means. There isn't any way to tell from just the DDL for one dimension table that you provided.
    It is not clear if you are saying that your fact table will have a direct relationship to the star-flake dimension tables or only link to them through the top-level dimensions.
    Some types of snowflakes do nothing more than normalize a dimension table to eliminate redundancy. For those types the dimension table is, in a sense, a 'mini' fact table and the other normalized tables become its children. The fact table only has a relation to the main dimension table; any data needed from the dimensions 'child' tables is obtained by joining them to their 'parent'.
    Other snowflake types have the main fact table having relations to one or more of the dimensions 'child' tables. That complicates the maintenance of the fact table since any change to the dimension 'child' table impacts the fact table also. It is not recommended to use that type of snowflake.
    See the 'Snowflake Schemas' section of the Data Warehousing Guide
    http://docs.oracle.com/cd/B28359_01/server.111/b28313/schemas.htm
    >
    Snowflake Schemas
    The snowflake schema is a more complex data warehouse model than a star schema, and is a type of star schema. It is called a snowflake schema because the diagram of the schema resembles a snowflake.
    Snowflake schemas normalize dimensions to eliminate redundancy. That is, the dimension data has been grouped into multiple tables instead of one large table. For example, a product dimension table in a star schema might be normalized into a products table, a product_category table, and a product_manufacturer table in a snowflake schema. While this saves space, it increases the number of dimension tables and requires more foreign key joins. The result is more complex queries and reduced query performance. Figure 19-3 presents a graphical representation of a snowflake schema.

  • More than one fact tables...

    Hi.
    I have tried OLAP until now with only one fact table.
    But now I have more than one. To start i added one more.
    I am always using SOLVED LEVEL...LOWEST LEVEL.
    I am always receiving the following error when creating the cube with this measures:
    "exact fetch returns more than requested number of rows"
    What shall I look for when dealing with more than one fact table?
    Thanks.
    ODDS
    :: ... and still have a very poor performance ...

    1.
    Well ... I saw the global star schema and we have two fact tables there!!!
    Do I have to build different cubes for each fact table always?
    2.
    I have built cubes, created a java client and a jsp client.
    Performance is much better in JSP using the AppServer(sure!).
    The power of the JSP client is more limited i presume.
    I wonder if I can do things such setCellEditing for a crosstab in both.
    3.
    Some aggregation questions:
    Everytime I create a cube using CWM2 and also a AW using AWM wizards with that cube I have one aggregation plan by default that processes everything online.
    After that I create and deploy my own aggregation plan.
    My question is: If I don't want to aggregate anything!??! I want to see, for instance, in BiBeans the lowest level values only. And everything at the top levels empty.
    I am missing something 'cause I still have everything aggregated !!!
    Thanks.
    ODDS

Maybe you are looking for