SUBH_3M_SALE_VW(SQL View) |
Index Back |
---|---|
3 Months Sales used by DSO90 |
SELECT H.business_unit , H.cust_id , subcust_qual1 , subcust_qual2 , currency_cd , SUM(hist_amt) , COUNT(*) FROM ps_subcust_history H , PS_CAL_CUR_PER_VW C WHERE C.SETID = ( SELECT SETID FROM PS_SET_CNTRL_REC WHERE SETCNTRLVALUE = H.BUSINESS_UNIT AND RECNAME = 'CAL_DEFN_TBL') AND C.CALENDAR_ID = ( SELECT CALENDAR_ID FROM PS_BUS_UNIT_OPT_AR O WHERE O.SETID = ( SELECT SETID FROM PS_SET_CNTRL_REC WHERE SETCNTRLVALUE = H.BUSINESS_UNIT AND RECNAME = 'BUS_UNIT_OPT_AR')) AND (H.FISCAL_YEAR * 1000 + H.ACCOUNTING_PERIOD BETWEEN C.FISCAL_YEAR * 1000 + C.ACCOUNTING_PERIOD - 3 AND C.FISCAL_YEAR * 1000 + C.ACCOUNTING_PERIOD -1 OR (C.ACCOUNTING_PERIOD - 3 < 1 AND H.FISCAL_YEAR * 1000 + H.ACCOUNTING_PERIOD BETWEEN (C.FISCAL_YEAR - 1) * 1000 + NUMBER_OF_PERIODS - 3 - C.ACCOUNTING_PERIOD AND (C.FISCAL_YEAR - 1) * 1000 + NUMBER_OF_PERIODS)) GROUP BY H.business_unit, H.cust_id, subcust_qual1, subcust_qual2, currency_cd |
# | PeopleSoft Field Name | PeopleSoft Field Type | Database Column Type | Description |
---|---|---|---|---|
1 | BUSINESS_UNIT | Character(5) | VARCHAR2(5) NOT NULL | Business Unit |
2 | CUST_ID | Character(15) | VARCHAR2(15) NOT NULL | Uniquely identifies an organizational entity that purchases goods or services from the enterprise. Represents the sold-to customer which is the customer organization that places orders. The CUST_ID may or may not be the same as the identifiers for the bill-to and ship-to locations. |
3 | SUBCUST_QUAL1 | Character(15) | VARCHAR2(15) NOT NULL | Specifies a user-defined grouping of customer receivables activity. A subcustomer qualifier provides the ability to record and report receivables activity across multiple business units and/or multiple customers. For example a subcustomer qualifier could represent a sales region or a geographic area. There are two possible subcustomer qualifiers: SUBCUST_QUAL1 and SUBCUST_QUAL2. |
4 | SUBCUST_QUAL2 | Character(15) | VARCHAR2(15) NOT NULL | Specifies a user-defined grouping of customer receivables activity. A subcustomer qualifier provides the ability to record and report receivables activity across multiple business units and/or multiple customers. For example a subcustomer qualifier could represent a sales region or a geographic area. There are two possible subcustomer qualifiers: SUBCUST_QUAL1 and SUBCUST_QUAL2. |
5 | CURRENCY_CD | Character(3) | VARCHAR2(3) NOT NULL | Currency Code |
6 | HIST_AMT | Signed Number(28,3) | DECIMAL(26,3) NOT NULL | History Amt |
7 | HIST_COUNT | Signed Number(6,0) | DECIMAL(5) NOT NULL | History Count |