Class MMeasureCalc

    • Constructor Detail

      • MMeasureCalc

        public MMeasureCalc​(Properties ctx,
                            int PA_MeasureCalc_ID,
                            String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        PA_MeasureCalc_ID - id
        trxName - trx
      • MMeasureCalc

        public MMeasureCalc​(Properties ctx,
                            ResultSet rs,
                            String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - trx
      • MMeasureCalc

        public MMeasureCalc​(MMeasureCalc copy)
        Parameters:
        copy -
    • Method Detail

      • get

        public static MMeasureCalc get​(int PA_MeasureCalc_ID)
        Get MMeasureCalc from Cache (immutable)
        Parameters:
        PA_MeasureCalc_ID - id
        Returns:
        MMeasureCalc
      • get

        public static MMeasureCalc get​(Properties ctx,
                                       int PA_MeasureCalc_ID)
        Get MMeasureCalc from Cache (immutable)
        Parameters:
        ctx - context
        PA_MeasureCalc_ID - id
        Returns:
        MMeasureCalc
      • getSqlPI

        public String getSqlPI​(MGoalRestriction[] restrictions,
                               String MeasureScope,
                               String MeasureDataType,
                               Timestamp reportDate,
                               MRole role)
        Get Sql to return single value for the Performance Indicator
        Parameters:
        restrictions - array of goal restrictions
        MeasureScope - scope of this value
        MeasureDataType - data type
        reportDate - optional report date
        role - role
        Returns:
        sql for performance indicator
      • getSqlBarChart

        public String getSqlBarChart​(MGoalRestriction[] restrictions,
                                     String MeasureDisplay,
                                     Timestamp startDate,
                                     MRole role)
        Get Sql to value for the bar chart
        Parameters:
        restrictions - array of goal restrictions
        MeasureDisplay - scope of this value
        startDate - optional report start date
        role - role
        Returns:
        sql for Bar Chart
      • getQuery

        public MQuery getQuery​(MGoalRestriction[] restrictions,
                               String MeasureDisplay,
                               Timestamp date,
                               MRole role)
        Get Zoom Query
        Parameters:
        restrictions - restrictions
        MeasureDisplay - display
        date - date
        role - role
        Returns:
        query
      • addRestrictions

        public static String addRestrictions​(String sql,
                                             boolean queryOnly,
                                             MGoalRestriction[] restrictions,
                                             MRole role,
                                             String tableName,
                                             String orgColumn,
                                             String bpColumn,
                                             String pColumn)
        Add Restrictions to SQL
        Parameters:
        sql - orig sql
        queryOnly - incomplete sql for query restriction
        restrictions - restrictions
        role - role
        tableName - table name
        orgColumn - org column
        bpColumn - bpartner column
        pColumn - product column
        Returns:
        updated sql
      • getTableName

        public String getTableName()
        Get Table Name
        Returns:
        Table Name