CUST_HST_LP_VW(SQL View) |
Index Back |
---|---|
Latest Period Bals by Customer |
SELECT s.setid , h.business_unit , h.cust_id , h.cust_hist_id , h.fiscal_year , h.accounting_period , h.HIST_AMT , h.hist_count , h.hist_compute , h.hist_weight , h.hist_dt , h.currency_cd , h.process_instance , 0 FROM PS_CUST_HISTORY h , ps_set_cntrl_rec s WHERE h.business_unit <> ' ' AND h.cust_id <> ' ' AND h.hist_amt <> 0 AND h.hist_count <> 0 AND H.FISCAL_YEAR = ( SELECT MAX(b.FISCAL_YEAR) FROM PS_CUST_HISTORY b WHERE b.BUSINESS_UNIT = H.BUSINESS_UNIT AND b.CUST_ID = H.CUST_ID AND b.CUST_HIST_ID = H.CUST_HIST_ID) AND H.ACCOUNTING_PERIOD = ( SELECT MAX(c.ACCOUNTING_PERIOD) FROM PS_CUST_HISTORY c WHERE c.BUSINESS_UNIT = H.BUSINESS_UNIT AND c.CUST_ID = H.CUST_ID AND c.CUST_HIST_ID = H.CUST_HIST_ID AND c.FISCAL_YEAR = H.FISCAL_YEAR) AND S.SETCNTRLVALUE = h.BUSINESS_UNIT AND S.RECNAME = 'CUSTOMER' |
# | PeopleSoft Field Name | PeopleSoft Field Type | Database Column Type | Description |
---|---|---|---|---|
1 | SETID | Character(5) | VARCHAR2(5) NOT NULL | SetID |
2 | BUSINESS_UNIT | Character(5) | VARCHAR2(5) NOT NULL | Business Unit |
3 | 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. |
4 | CUST_HIST_ID | Character(10) | VARCHAR2(10) NOT NULL | History ID |
5 | FISCAL_YEAR | Number(4,0) | SMALLINT NOT NULL | Fiscal Year |
6 | ACCOUNTING_PERIOD | Number(3,0) | SMALLINT NOT NULL | Identifies a time period to which you post transactions. Typically, an accounting period represents a month, but it can also represent a week, a day, or any user-defined interval. An accounting period has a beginning date and an ending date, and is defined in the calendar table. |
7 | HIST_AMT | Signed Number(28,3) | DECIMAL(26,3) NOT NULL | History Amt |
8 | HIST_COUNT | Signed Number(6,0) | DECIMAL(5) NOT NULL | History Count |
9 | HIST_COMPUTE | Character(1) | VARCHAR2(1) NOT NULL |
History Grouping Computation
A=Average S=Sum W=Weighted Average |
10 | HIST_WEIGHT | Signed Number(28,3) | DECIMAL(26,3) NOT NULL | Weighting Amt |
11 | HIST_DT | Date(10) | DATE | History Date |
12 | CURRENCY_CD | Character(3) | VARCHAR2(3) NOT NULL | Currency Code |
13 | PROCESS_INSTANCE | Number(10,0) | DECIMAL(10) NOT NULL | Process Instance |
14 | TOTAL_AVG_DAYS | Signed Number(17,2) | DECIMAL(15,2) NOT NULL | Overall Weighted Average Days |