Examples of NumberSource


Examples of oracle.olapi.data.source.NumberSource

  {
    println("\nUsing COMPARISON_RULE_DESCENDING");

    // Get the UNIT_PRICE_AW measure and the Source for it.
    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();

    // Get the PRODUCT and TIME dimensions.
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");

    // Get the short description attribute for the dimensions.
    MdmAttribute mdmProdShortDescrAttr =
                mdmProdDim.getShortValueDescriptionAttribute();
    MdmAttribute mdmTimeShortDescrAttr =
                mdmTimeDim.getShortValueDescriptionAttribute();

    // Get the Source objects for the attributes.
    Source prodShortDescr = mdmProdShortDescrAttr.getSource();
    Source timeShortDescr = mdmTimeShortDescrAttr.getSource();

    // Get the default hierarchies of the dimensions and their Source objects.
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmTimeHIer = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    Source prodHier = mdmProdHier.getSource();
    StringSource timeHier = (StringSource) mdmTimeHIer.getSource();

    // Get the FAMILY level of the hierarchy and the Source for it.
      MdmLevel mdmFamilyLevel =
                     getContext().getLevelByName(mdmProdHier, "FAMILY_AW");
      Source prodSel = mdmFamilyLevel.getSource();

    // Join the family elements to the product short description attribute.
    Source prodSelWithShortDescr = prodShortDescr.join(prodSel);

    // Select the May, 2001.
    Source timeSel = timeHier.selectValue("CALENDAR_YEAR_AW::MONTH_AW::59");

    // Join the time selection to the time short description attribute.
    Source timeSelWithShortDescr = timeShortDescr.join(timeSel);


    Source result =
                 prodSelWithShortDescr.join(unitPrice,
                                            unitPrice.getDataType(),
                                            Source.COMPARISON_RULE_DESCENDING,
                                            true)
                                      .join(timeSelWithShortDescr);

      prepareAndCommit();
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

    MdmMeasure mdmSales     = getMdmMeasure("SALES_AW");
    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");

    // Get the Source objects for the measure and for the default hierarchies
    // of the dimensions.
    NumberSource units = (NumberSource) mdmUnits.getSource();
    NumberSource sales = (NumberSource) mdmSales.getSource();
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();

    StringSource prodHier = (StringSource)
        getMdmPrimaryDimension("PRODUCT_AW").getDefaultHierarchy().getSource();
    StringSource custHier = (StringSource)
        getMdmPrimaryDimension("CUSTOMER_AW").getDefaultHierarchy().getSource();
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

    // Get the Source for the default product hierarchy                                   .
    StringSource prodHier = (StringSource) mdmProdHier.getSource();

    // Get the Source objects for the measure and for the default hierarchies
    // of the other dimensions.
    NumberSource units = (NumberSource) mdmUnits.getSource();

    // Get the parent attribute of the PRODUCT dimension and the Source for it
    // to use in the recursiveJoin method.
    MdmAttribute mdmProdParentAttr = mdmProdHier.getParentAttribute();
    Source prodParent = mdmProdParentAttr.getSource();

    // Get the short value description attribute and its Source.
    MdmAttribute mdmProdShortDescrAttr =
                                mdmProdDim.getShortValueDescriptionAttribute();
    Source prodShortDescr = mdmProdShortDescrAttr.getSource();

    // Select the Direct Sales channel, the year 2001, and all customers.
    Source chanSel = chanHier.selectValue("CHANNEL_PRIMARY_AW::CHANNEL_AW::2");
    Source timeSel = timeHier.selectValue("CALENDAR_YEAR_AW::YEAR_AW::4");
    Source custSel = custHier.selectValue("SHIPMENTS_AW::TOTAL_CUSTOMER_AW::1");

    // Sort all products hierarchically in ascending order of units sold,
    // with parents first.
    Source sortedProduct =
                      prodHier.recursiveJoin(units,
                                             units.getDataType(),
                                             prodParent,
                                             Source.COMPARISON_RULE_ASCENDING,
                                             true,  // Parents first
                                             true); // Restrict parents to base

    // Get the short value description of the products.
    Source sortedProductShortDescr = prodShortDescr.join(sortedProduct);

    // Produce a Source that has the units sold measure data as its element
    // values and sortedProductShortDescr as its output.
    // Since the other dimensions are all single values, use joinHidden so
    // the are not outputs of the result.

    Source result = units.join(sortedProductShortDescr)
                         .joinHidden(custSel)
                         .joinHidden(chanSel)
                         .joinHidden(timeSel);

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

Examples of oracle.olapi.data.source.NumberSource

       
    // Get the 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();
   
    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, "PRODUCT_PRIMARY_AW::ITEM_AW::14")))
                  .plus(
                  (NumberSource)
                  (ph.join(prodHier, "PRODUCT_PRIMARY_AW::ITEM_AW::15")));
       
    // Get the level to which the dimension members belong.
    MdmLevel mdmItemLevel = getContext().getLevelByName(mdmProdPrimary,
                                                        "ITEM_AW");
       
    // 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[]{"PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                            "PRODUCT_PRIMARY_AW::ITEM_AW::15",
                                            "PRODUCT_PRIMARY_AW::ITEM_AW::60"});
                       
    // 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, "CALENDAR_YEAR_AW::MONTH_AW::47");
                       
    // Prepare and commit the current Transaction.
    prepareAndCommit();
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

  {
    println("Creating a Custom Member of the MdmMeasureDimension\n");
       
    // Get the measures and the Source objects for the measures.
    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();
       
    MdmMeasure mdmUnitCost = getMdmMeasure("UNIT_COST_AW");
    NumberSource unitCost = (NumberSource) mdmUnitCost.getSource();
       
    // Get the primary dimensions for the measures.
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
       
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

    throws NotCommittableException
  {
    println("\nPositions in an Asymmetric Query");

    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");
    NumberSource units = (NumberSource) mdmUnits.getSource();
    Source unitsGT1 = units.gt(1);

    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.selectValue("SHIPMENTS_AW::SHIP_TO_AW::61");

    // Create the query
    Source querySource2 = prodSel.join(chanSel)
                                 .join(custSel)
                                 .join(timeSel)
                                 .select(units.gt(1));

    //Prepare and commit the current Transaction.
    prepareAndCommit();

    // Create the Cursor. The DataProvider is dp.
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

    // Get the Source for the default product hierarchy.
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
       
    // Get the Source objects for the measure and for the default hierarchies
    // of the other dimensions.
    NumberSource units = (NumberSource) mdmUnits.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();
       
    Source totalProds =
           prodHier.selectValue("PRODUCT_PRIMARY_AW::TOTAL_PRODUCT_AW::1");
       
    MdmLevel mdmProdFamilies = getContext().getLevelByName(mdmProdHier,
                                                           "FAMILY_AW");
    Source prodFamilies = mdmProdFamilies.getSource();
   
    // Get the Source for the short value description attribute of the dimension.
    Source prodShortLabel = mdmProdDim.getShortValueDescriptionAttribute()
                                      .getSource();
       
    Source prodFamiliesShortDesc = prodShortLabel.join(prodFamilies);
       
    NumberSource totalUnits = (NumberSource) units.joinHidden(totalProds);
       
    Source productShare = units.div(totalUnits).times(100);
       
    Source result =
          //productShare.join(prodFamilies)
View Full Code Here

Examples of oracle.olapi.data.source.NumberSource

  protected void run() throws Exception
  {
    println("Using the Lag 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 unitPriceLag4 = unitPrice.lag(mdmTimeHier, 4);
    Source measuresDim =
        getExpressDataProvider().createListSource(new Source[] {unitPrice,
                                                                unitPriceLag4});

    Source lagResult = measuresDim.extract()
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.