US and Worldwide: +1 (866) 660-7555
Results 1 to 2 of 2

Thread: Using <SQl> inside

  1. #1
    Join Date
    Apr 2013
    Posts
    1

    Default Using <SQl> inside

    Hi Team,
    I'm Davide a new adept
    I have a question, this is my mondrian file for genereting an Olap:

    <Schema name="OlapCarrelli">
    <Dimension visible="true" highCardinality="false" name="Store">
    <Hierarchy visible="true" hasAll="true" allMemberName="All Stores" primaryKey="PK_STORE">
    <Table name="D_STORE">
    </Table>
    <Level name="Store" visible="true" column="STORE_NAME" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Store">
    </Level>
    </Hierarchy>
    </Dimension>
    <Dimension visible="true" highCardinality="false" name="Accesso">
    <Hierarchy visible="true" hasAll="true" allMemberName="All Access" primaryKey="PK_TIME">
    <Table name="D_TIME">
    </Table>
    <Level name="Year" visible="true" column="YEAR" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Year">
    </Level>
    <Level name="Quarter" visible="true" column="QUARTER_NAME" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Quarter">
    </Level>
    <Level name="Month" visible="true" column="MONTH_NAME" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Month">
    </Level>
    </Hierarchy>
    </Dimension>
    <Dimension visible="true" highCardinality="false" name="Cliente">
    <Hierarchy visible="true" hasAll="true" allMemberName="All Clients" primaryKey="PK_CUSTOMER">
    <Table name="D_CUSTOMER">
    </Table>
    <Level name="Sesso" visible="true" column="GENDER" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Sesso">
    </Level>
    <Level name="Registrazione" visible="true" column="REGISTRATION_FLAG" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Registrazione">
    </Level>
    <Level name="Newsletter" visible="true" column="NEWSLETTER_FLAG" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Newsletter">
    </Level>
    <Level name="Codice Fiscale" visible="true" column="FISCAL_CODE_FLAG" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Codice Fiscale">
    </Level>
    </Hierarchy>
    </Dimension>
    <Dimension visible="true" highCardinality="false" name="Territory">
    <Hierarchy visible="true" hasAll="true" allMemberName="All Territories" primaryKey="PK_TERRITORY">
    <Table name="D_TERRITORY">
    </Table>
    <Level name="territorio" visible="true" column="COUNTRY_NAME" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="territorio">
    </Level>
    <Level name="Regione" visible="true" column="REGION_NAME" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Regione">
    </Level>
    <Level name="Città" visible="true" column="CITY_NAME" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="città">
    </Level>
    <Level name="Indirizzo" visible="true" column="ADDRESS" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Indirizzo">
    </Level>
    </Hierarchy>
    </Dimension>
    <Dimension visible="true" highCardinality="false" name="Dettagli">
    <Hierarchy visible="true" hasAll="true" allMemberName="All Details" primaryKey="PK_ACCESS_DETAIL">
    <Table name="D_ACCESSES_DETAIL">
    </Table>
    <Level name="Sistema Operativo" visible="true" column="OS_TYPE" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Sistema operativo">
    </Level>
    <Level name="Versione" visible="true" column="OS_VERSION" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Versione">
    </Level>
    <Level name="Tipo Browser" visible="true" column="BROWSER_TYPE" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Tipo Browser">
    </Level>
    <Level name="Versione Browser" visible="true" column="BROWSER_VERSION" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Versione Browser">
    </Level>
    <Level name="Tipo Device" visible="true" column="DEVICE_TYPE" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never" description="Tipo Device">
    </Level>
    </Hierarchy>
    </Dimension>
    <Cube name="CuboCarrelli" visible="true" cache="true" enabled="true">
    <Table name="FP_CART">
    </Table>
    <DimensionUsage source="Store" name="Store" visible="true" foreignKey="PK_STORE" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Accesso" name="Accesso" visible="true" foreignKey="PK_CREATION_CART_TIME" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Accesso" name="Accesso" visible="true" foreignKey="PK_LAST_MODIFIED_CART" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Cliente" name="Cliente" visible="true" foreignKey="PK_CUSTOMER" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Territory" name="Territory" visible="true" foreignKey="PK_INVOICE_ADDRESS" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Territory" name="Territory" visible="true" foreignKey="PK_SHIPMENT_ADDRESS" highCardinality="false">
    </DimensionUsage>
    <DimensionUsage source="Dettagli" name="Dettagli" visible="true" foreignKey="PK_ORDER_DETAIL" highCardinality="false">
    </DimensionUsage>
    <Measure name="Costo_totale_clienti" column="TOT_CUSTOMER_COST" formatString="#" aggregator="sum">
    </Measure>
    <Measure name="Quantita_sku_vendute" column="TOT_SKU_QUANTITY" formatString="#" aggregator="sum">
    </MeasureExpression>
    </Measure>
    </Cube>
    </Schema>

    it works !!!

    but after adding the following expression into the tags related to the measures , "Costo_totale_client"i and "Quantita_sku_vendute"
    <MeasureExpression>
    <SQL dialect="oracle">
    (case when fp_cart.payment_flag=1 then fp_cart.tot_customer_cost else 0 end)
    </SQL>
    </MeasureExpression>

    the system returned the following error:


    org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException:
    java.util.MissingResourceException: Can't find resource
    for bundle org.eigenbase.resgen.ShadowResourceBundle$MyPropertyResourceBundle, key BadMeasureSource at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)....

    Any ideas?

    Regards,

    Davide

  2. #2
    Join Date
    Jan 2013
    Posts
    356

    Default

    Did you remove the column attribute from the measure you added a sql expression to?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •