Examples of NumberSource


Examples of oracle.olapi.data.source.NumberSource

    Source chanHier = (Source) sourceList.get(4);
    Source prodShortDescr = (Source) sourceList.get(5);
   
    // Example from NumberParameter.
    NumberParameter numParam = new NumberParameter(dp, 1000);
    NumberSource numParamSrc = dp.createParameterizedSource(numParam);
   
    NumberSource qualifiedUnits = (NumberSource)
                     units.join(timeHier, "CALENDAR_YEAR_AW::YEAR_AW::4")
                          .join(custHier, "SHIPMENTS_AW::REGION_AW::9")
                          .join(chanHier,"CHANNEL_PRIMARY_AW::CHANNEL_AW::4");
   
    Source paramProdSel = prodHier.select(qualifiedUnits.gt(numParamSrc));
    Source results = prodShortDescr.join(paramProdSel);
   
    try
    {
      prepareAndCommit();
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

       
    // Get the measures and the Source objects for them.
    MdmMeasure mdmUnitCost = getMdmMeasure("AMOUNT");
    MdmMeasure mdmUnitPrice = getMdmMeasure("SCC_AMOUNT");
       
    NumberSource unitCost = (NumberSource) mdmUnitCost.getSource();
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();
   
    DataProvider dp = getContext().getDataProvider();
       
    // Get the placeholder Source for the Number data type.
    Source ph = dp.getFundamentalMetadataProvider().getNumberPlaceholder()
                                                   .getSource();
       
    // Create a Source that specifies the value to assign as the
    // value of a measure for the custom dimension member.
//    Source calc = ((NumberSource)
//                   (ph.join(prodHier, "DEPT::0")))
//                  .plus(
//                  (NumberSource)
//                  (ph.join(prodHier, "DEPT::1")));
       
    // Get the level to which the dimension members belong.
//    MdmLevel mdmItemLevel = getContext().getLevelByName(mdmProdPrimary,
//                                                        "DEPT");
//       
//    // Create the custom dimension member.
//    MdmStandardMember mdmItem60 = mdmProdStdDim.createCustomMember(
//                                                "60",  // member local value
//                                                 mdmItemLevel, // member level
//                                                 "4",   // parent local value
//                                                 calc, // calculation Source
//                                                 10);   // precedence value
       
    // Select a set of Product member values.
    StringSource prodSel = prodHier.selectValues(
                               new String[]{"MEDIA::MEDIA::0",
                                            "MEDIA::MEDIA::1"});
                       
    // Produce a query that specifies the unit price and the unit cost for the
    // selected products and the specified month. The month does not appear
    // in the result.
    Source result = unitPrice.join(unitCost)
                             .join(prodSel)
                             .join(calendar, "TIMEHIER::DAY::20110101");
                       
    // Prepare and commit the current Transaction.
    prepareAndCommit();
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

  {
    println("\nGetting ValueCursor Objects from a CompoundCursor");

    // Get the metadata objects.
    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");
    NumberSource units = (NumberSource) mdmUnits.getSource();

    MdmPrimaryDimension mdmChanDim = getMdmPrimaryDimension("CHANNEL_AW");
    MdmPrimaryDimension mdmCustDim = getMdmPrimaryDimension("CUSTOMER_AW");
    MdmLevelHierarchy mdmChanHier = (MdmLevelHierarchy)
                                     mdmChanDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCustHier = (MdmLevelHierarchy)
                                     mdmCustDim.getDefaultHierarchy();

    StringSource chanHier = (StringSource) mdmChanHier.getSource();
    StringSource custHier = (StringSource) mdmCustHier.getSource();

    Source chanSel = chanHier.selectValue("CHANNEL_PRIMARY_AW::CHANNEL_AW::2");

    Source custSel = custHier.selectValues(new String[] {
                                            "SHIPMENTS_AW::SHIP_TO_AW::58",
                                            "SHIPMENTS_AW::SHIP_TO_AW::61",
                                            "SHIPMENTS_AW::SHIP_TO_AW::65"});

    Source prodSel = prodHier.selectValues(new String[] {
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::15"});

    Source timeSel = timeHier.selectValues(new String[] {
                                            "CALENDAR_YEAR_AW::MONTH_AW::43",
                                            "CALENDAR_YEAR_AW::MONTH_AW::44",
                                            "CALENDAR_YEAR_AW::MONTH_AW::45"});

    // Code from the example.
    Source unitsForSelections = units.join(prodSel)
                                     .join(custSel)
                                     .join(timeSel)
                                     .join(chanSel);

    // Prepare and commit the current Transaction.
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

  {
    println("\nGetting ValueCursor Objects from a CompoundCursor");

    // Get the metadata objects.
    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");
    NumberSource units = (NumberSource) mdmUnits.getSource();

    MdmPrimaryDimension mdmChanDim = getMdmPrimaryDimension("CHANNEL_AW");
    MdmPrimaryDimension mdmCustDim = getMdmPrimaryDimension("CUSTOMER_AW");
    MdmLevelHierarchy mdmChanHier = (MdmLevelHierarchy)
                                     mdmChanDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCustHier = (MdmLevelHierarchy)
                                     mdmCustDim.getDefaultHierarchy();

    StringSource chanHier = (StringSource) mdmChanHier.getSource();
    StringSource custHier = (StringSource) mdmCustHier.getSource();

    Source chanSel = chanHier.selectValue("CHANNEL_PRIMARY_AW::CHANNEL_AW::2");

    Source custSel = custHier.selectValues(new String[] {
                                            "SHIPMENTS_AW::SHIP_TO_AW::58",
                                            "SHIPMENTS_AW::SHIP_TO_AW::61",
                                            "SHIPMENTS_AW::SHIP_TO_AW::65"});

    Source prodSel = prodHier.selectValues(new String[] {
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::15"});

    Source timeSel = timeHier.selectValues(new String[] {
                                            "CALENDAR_YEAR_AW::MONTH_AW::43",
                                            "CALENDAR_YEAR_AW::MONTH_AW::44",
                                            "CALENDAR_YEAR_AW::MONTH_AW::45"});

    // Code from the example.
    Source unitsForSelections = units.join(prodSel)
                                     .join(custSel)
                                     .join(timeSel)
                                     .join(chanSel);

    // Prepare and commit the current Transaction.
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

    // Get the DataProvider.
    DataProvider dp = getContext().getDataProvider();
   
    // Get the Sales measure and the Source for it.
     MdmMeasure mdmSales = getMdmMeasure("SALES_AW");
     NumberSource sales = (NumberSource) mdmSales.getSource();
   
    // Get the dimensions. Cast the Product dimension as an MdmStandardDimension
    // so that it has a createCustomMember method.
    MdmStandardDimension mdmProdStdDim = (MdmStandardDimension)
    getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
    MdmPrimaryDimension mdmChanDim = getMdmPrimaryDimension("CHANNEL_AW");
    MdmPrimaryDimension mdmCustDim = getMdmPrimaryDimension("CUSTOMER_AW");
   
    // Get the Source for the product dimension.
    Source prodStdDim = mdmProdStdDim.getSource();
       
    // Get the marketing manager attribute and the Source for it.   
    MdmAttribute mdmMktMngrAttr = getContext().getAttributeByName(mdmProdStdDim,
                                                        "MARKETING_MANAGER_AW");
    Source mktMngrAttr = mdmMktMngrAttr.getSource();
       
    // Get the default hierarchies of the dimensions and the Source objects
    // for them.
    MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdStdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmChanHier = (MdmLevelHierarchy)
                                     mdmChanDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmShipHier = (MdmLevelHierarchy)
                                     mdmCustDim.getDefaultHierarchy();
   
    StringSource calendar = (StringSource) mdmCalendar.getSource();
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
    StringSource chanHier = (StringSource) mdmChanHier.getSource();
    StringSource shipHier = (StringSource) mdmShipHier.getSource();
   
    // Get the placeholder Source for the Number data type.
    Source ph = dp.getFundamentalMetadataProvider()
                  .getNumberPlaceholder()
                  .getSource();
   
    // Get the level to which the dimension members belong.
    MdmLevel mdmItemLevel = getContext().getLevelByName(mdmProdHier,
                                                        "ITEM_AW");

    // Get the Source for the ITEM level.
    Source itemLevel = mdmItemLevel.getSource();
   
    // Select the members of the level that are managed by a marketing manager.
    Source prodForManager = itemLevel.join(mktMngrAttr, "Jackson");
   
    // Get the short value description attribute for Product and the Source
    // for it.
    MdmAttribute mdmProdShortDescr =
                         mdmProdStdDim.getShortValueDescriptionAttribute();
    Source prodShortDescr = mdmProdShortDescr.getSource();
   
    // Create the calculation Source, which specifies the aggregation of
    // the selected products.
    Source calc = ((NumberSource)
              (ph.join(prodHier,
                   new String[] {"PRODUCT_PRIMARY_AW::ITEM_AW::24",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::25",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::26",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::33",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::34",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::35",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::36",
                                "PRODUCT_PRIMARY_AW::ITEM_AW::37",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::38",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::39"}))).total();
                       
    // Create the custom dimension member.
    MdmStandardMember mdmMktMngrTotal =
            mdmProdStdDim.createCustomMember("65"// member local value
                                             mdmItemLevel, // member level
                                             "4",   // parent local value
                                             calc, // calculation Source
                                             10);   // precedence value
   
    // Set the short value description for the custom member.
    mdmMktMngrTotal.setShortDescription("Marketing Manager Total");
   
    // Append the custom member to the product selection.
    Source mktMngrWithTotal = prodForManager.appendValue(
                              prodHier.selectValue(
                                        "PRODUCT_PRIMARY_AW::ITEM_AW::65"));
   
    // Create a query that specifies the units sold of the selected products,
    // including a short description of the products, for the specified customer
    // through all sales channels in the specified year.
    Source result = sales.join(prodShortDescr.join(mktMngrWithTotal))
                         .join(shipHier, "SHIPMENTS_AW::SHIP_TO_AW::106")
                         .join(chanHier, "CHANNEL_PRIMARY_AW::TOTAL_CHANNEL_AW::1")
                         .join(calendar, "CALENDAR_YEAR_AW::YEAR_AW::3");
   
    // Prepare and commit the current Transaction.
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

   
    // Get the MdmMeasure objects and the Source objects for them.
    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
    MdmMeasure mdmUnitCost = getMdmMeasure("UNIT_COST_AW");
       
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();
    NumberSource unitCost = (NumberSource) mdmUnitCost.getSource();
       
    // Get the MdmPrimaryDimension objects and the default hierarchies for them.
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
       
    MdmLevelHierarchy mdmProdRollup = (MdmLevelHierarchy)
                                       mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
                                      mdmTimeDim.getDefaultHierarchy();
       
    // Get the Source objects for the hierarchies.
    StringSource prodRollup = (StringSource) mdmProdRollup.getSource();
    StringSource calendar = (StringSource) mdmCalendar.getSource();
       
    // Create a Source that represents a selection of Product dimension members.
    Source prodSel = prodRollup.selectValues(new String[]
                                            {"PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::15"});
                
    // Create a Source that is the result of a calculation involving two measures.
    Source calculation = unitPrice.minus(unitCost);
                
    // Create a Source whose element values are the Source objects for the
    // measures and the calculation. The resulting Source is like a measure
    // dimension.
    Source sourceListSrc = dp.createListSource(new Source[] {unitPrice,
                                                             unitCost,
                                                             calculation});

    // Use the extract method and then join Source objects that match the
    // inputs of the Source objects in the list.
    Source resultUsingExtract =
                 sourceListSrc.extract()
                              .join(sourceListSrc)
                              .join(prodSel)
                              .join(calendar, "CALENDAR_YEAR_AW::MONTH_AW::47");
                            
    // Prepare and commit the current Transaction.
    prepareAndCommit();
                            
    // Create a Cursor for the query and display the values of the Cursor.
    println("The values using extract method are:");
    getContext().displayResult(resultUsingExtract);
                            
    // Produce the same result using a CustomModel directly.
    CustomModel customModel = dp.createModel(sourceListSrc);
    customModel.assign(unitPrice.getID(), unitPrice);
    customModel.assign(unitCost.getID(), unitCost);
    customModel.assign(calculation.getID(), calculation);
                            
    Source measValForSrc = customModel.createSolvedSource();
                            
    // Join Source objects that match the inputs of the solved Source produced by
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

       
    // Get the Unit Cost and Unit Price measures and the Source objects for them.
    MdmMeasure mdmUnitCost = getMdmMeasure("UNIT_COST_AW");
    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
       
    NumberSource unitCost = (NumberSource) mdmUnitCost.getSource();
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();
       
    // Get the level to which the dimension members belong.
    MdmLevel mdmItemLevel = getContext().getLevelByName(mdmProdPrimary,
                                                        "ITEM_AW");
       
    // Get the placeholder Source for the Number data type.
    Source ph = dp.getFundamentalMetadataProvider()
                  .getNumberPlaceholder()
                  .getSource();
       
    // Get a Source that specifies the value to assign for the custom member.
    Source calc = ((NumberSource)
                   (ph.join(prodPrimary, "PRODUCT_PRIMARY_AW::ITEM_AW::14")))
                   .plus(
                   (NumberSource)
                   (ph.join(prodPrimary, "PRODUCT_PRIMARY_AW::ITEM_AW::15")));
       
       
    // Create a custom member of the Item level of the Product dimension.
    MdmStandardMember mdmItem60 =
              mdmProdStdDim.createCustomMember("60"// member local value
                                                mdmItemLevel, // member level
                                                "4",   // parent local value
                                                calc, // calculation Source
                                                10);   // precedence value
       
    // Get a Source that specifies a value to assign for another custom member
    // that depends on the value to assign for the first custom member.
    Source dependentCalc = ((NumberSource)
                            (ph.join(prodPrimary,
                                     "PRODUCT_PRIMARY_AW::ITEM_AW::60")))
                            .plus(
                            (NumberSource)
                            (ph.join(prodPrimary,
                                     "PRODUCT_PRIMARY_AW::ITEM_AW::13")));
       
    // Create another custom member of the Item level of the Product dimension.
    MdmStandardMember mdmItem61 =
                          mdmProdStdDim.createCustomMember("61",
                                                           mdmItemLevel,
                                                           "4",
                                                           dependentCalc,
                                                           10);
       
    // Produce a selection of hierarchy members that includes the custom members.
    StringSource prodSel = prodPrimary.selectValues(
                                new String[]{"PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::15",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::60",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::61"
                                             });
       
    // Produce a Source that specifies the Unit Cost and Unit Price values
    // for the selected Product and Time dimension members.
    Source result = unitPrice.join(unitCost)
                             .join(prodSel)
                             .join(calendar, "CALENDAR_YEAR_AW::MONTH_AW::47");
       
    // Prepare and commit the current Transaction.
    prepareAndCommit();
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

    // of the range.
    NumberParameter startParam = new NumberParameter(dp, 1);
    NumberParameter endParam = new NumberParameter(dp, 6);

    // Create parameterized Source objects.
    NumberSource startParamSrc = dp.createParameterizedSource(startParam);
    NumberSource endParamSrc = dp.createParameterizedSource(endParam);

    // Specify a set of positions of the products dimension using the
    // parameterized Source objects.
    Source paramProdSelInterval = prodHier.interval(startParamSrc,
                                                    endParamSrc);
    // Get the short description attribute for the Product dimension and
    // get the Source for the attribute.
    MdmAttribute mdmProdShortDescr =
                               mdmProdDim.getShortValueDescriptionAttribute();
    Source prodShortDescr = mdmProdShortDescr.getSource();

    // Join the selected products to the short descriptions.
    Source paramProdSelIntervalShortDescr =
                                    prodShortDescr.join(paramProdSelInterval);

    // Join units to selected values from three of the dimensions.
    // These join shortcuts hide the output.
    // Join the parameterized Source, also.
    NumberSource result = (NumberSource)
                            units.join(chanHier,
                                       "CHANNEL_PRIMARY_AW::CHANNEL_AW::4")
                                 .join(timeHier, "CALENDAR_YEAR_AW::YEAR_AW::4")
                                 .join(shipHier,
                                       "SHIPMENTS_AW::TOTAL_CUSTOMER_AW::1")
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

  protected void run() throws Exception
  {
    println("Using the movingTotal Method");

    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();

    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                    mdmProdDim.getDefaultHierarchy();
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
    Source prodSel = prodHier.selectValue("PRODUCT_PRIMARY_AW::FAMILY_AW::5");

    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
    MdmLevelHierarchy mdmTimeHier = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    StringSource timeHier = (StringSource) mdmTimeHier.getSource();

    MdmLevel mdmQuarterLevel = getContext().getLevelByName(mdmTimeHier,
                                                           "QUARTER_AW");
    Source quarterLevel = mdmQuarterLevel.getSource();

    NumberSource unitPriceMovingTotal =
                                       unitPrice.movingTotal(mdmTimeHier, 0, 3);


    Source measuresDim = getExpressDataProvider().createListSource(new Source[]
                                                        {unitPrice,
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");

    // Get the Source objects for the measure and for the default hierarchies
    // of the dimensions.
    NumberSource units = (NumberSource) mdmUnits.getSource();
    StringSource prodHier = (StringSource)
        getMdmPrimaryDimension("PRODUCT_AW").getDefaultHierarchy().getSource();
    StringSource custHier = (StringSource)
        getMdmPrimaryDimension("CUSTOMER_AW").getDefaultHierarchy().getSource();
    StringSource chanHier = (StringSource)
        getMdmPrimaryDimension("CHANNEL_AW").getDefaultHierarchy().getSource();
    StringSource timeHier = (StringSource)
        getMdmPrimaryDimension("TIME_AW").getDefaultHierarchy().getSource();

    // Select single values for the hierarchies.
    Source prodSel = prodHier.selectValue("PRODUCT_PRIMARY_AW::ITEM_AW::15");
    Source custSel = custHier.selectValue("SHIPMENTS_AW::SHIP_TO_AW::52");
    Source timeSel = timeHier.selectValue("CALENDAR_YEAR_AW::MONTH_AW::55");

    // Produce a Source that specifies the units values for the selected
    // dimension values.
    Source unitsSel = units.join(timeSel).join(custSel).join(prodSel);

    // Create aliases for the Channel dimension hierarchy.
    Source chanAlias1 = chanHier.alias();
    Source chanAlias2 = chanHier.alias();

    // Join the aliases to the Source representing the units values specified
    // by the selected dimension elements, using the value method to make the
    // alias an input.
    NumberSource unitsSel1 = (NumberSource) unitsSel.join(chanAlias1.value());
    NumberSource unitsSel2 = (NumberSource) unitsSel.join(chanAlias2.value());

    // chanAlias2 is the first output of result, so its values are the row
    // (slower varying) values; chanAlias1 is the second output of result
    // so its values are the column (faster varying) values.
    Source result = unitsSel1.gt(unitsSel2)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.