C360_HIST_C_VW

(SQL View)
Index Back

Customer History Recent


SELECT R.SETID , H.BUSINESS_UNIT , H.CUST_ID , H.FISCAL_YEAR , H.CURRENCY_CD , SUM(CASE WHEN H.CUST_HIST_ID = 'SALES' THEN H.HIST_AMT ELSE 0 END) AS HI_SALES , SUM(CASE WHEN H.CUST_HIST_ID = 'HI_BAL_AMT' THEN H.HIST_AMT ELSE 0 END) AS HI_BAL_AMT , SUM(CASE WHEN H.CUST_HIST_ID = 'AVGDAYS' THEN H.HIST_AMT ELSE 0 END) AS HI_AVGDAYS , SUM(CASE WHEN H.CUST_HIST_ID = 'CURRENTDUE' THEN H.HIST_AMT ELSE 0 END) AS HI_CURRENTDUE , SUM(CASE WHEN H.CUST_HIST_ID = 'DSO30' THEN H.HIST_AMT ELSE 0 END) AS HI_DSO30 , SUM(CASE WHEN H.CUST_HIST_ID = 'DSO90' THEN H.HIST_AMT ELSE 0 END) AS HI_DSO90 , SUM(CASE WHEN H.CUST_HIST_ID = 'HI_FUTURE' THEN H.HIST_AMT ELSE 0 END) AS HI_FUTURE , SUM(CASE WHEN H.CUST_HIST_ID = 'HI_CURRENT' THEN H.HIST_AMT ELSE 0 END) AS HI_CURRENT , SUM(CASE WHEN H.CUST_HIST_ID = 'OTHERDUE' THEN H.HIST_AMT ELSE 0 END) AS HI_OTHERDUE , SUM(CASE WHEN H.CUST_HIST_ID = 'HI_PAST' THEN H.HIST_AMT ELSE 0 END) AS HI_PAST , SUM(CASE WHEN H.CUST_HIST_ID = 'HI_OTHER' THEN H.HIST_AMT ELSE 0 END) AS HI_OTHER , SUM(CASE WHEN H.CUST_HIST_ID = 'PASTDUE' THEN H.HIST_AMT ELSE 0 END) AS HI_PASTDUE , SUM(CASE WHEN H.CUST_HIST_ID = 'WTAVGDAYS' THEN H.HIST_AMT ELSE 0 END) AS HI_WTAVGDAYS , SUM(CASE WHEN H.CUST_HIST_ID = 'WTAVGPAID' THEN H.HIST_AMT ELSE 0 END) AS HI_WTAVGPAID , SUM(CASE WHEN H.CUST_HIST_ID = 'WTAVGTERMS' THEN H.HIST_AMT ELSE 0 END) AS HI_WTAVGTERMS FROM PS_CUST_HISTORY H , PS_SET_CNTRL_REC R WHERE R.SETCNTRLVALUE = H.BUSINESS_UNIT AND R.RECNAME = 'CUSTOMER' GROUP BY R.SETID, H.BUSINESS_UNIT, H.CUST_ID, H.FISCAL_YEAR, H.CURRENCY_CD

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 SETID Character(5) VARCHAR2(5) NOT NULL SetID

Prompt Table: SP_SETID_NONVW

2 BUSINESS_UNIT Character(5) VARCHAR2(5) NOT NULL Business Unit

Prompt Table: SP_BUARDS_NONVW

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 FISCAL_YEAR Number(4,0) SMALLINT NOT NULL Fiscal Year
5 CURRENCY_CD Character(3) VARCHAR2(3) NOT NULL Currency Code
6 C360_HI_SALES Signed Number(28,3) DECIMAL(26,3) NOT NULL YTD Sales
7 C360_HI_BAL_AMT Signed Number(28,3) DECIMAL(26,3) NOT NULL High Balance
8 C360_HI_AVGDAYS Signed Number(28,3) DECIMAL(26,3) NOT NULL Avg Days Late
9 C360_HI_CURRENTDUE Signed Number(28,3) DECIMAL(26,3) NOT NULL High Current Due
10 C360_HI_DS030 Signed Number(28,3) DECIMAL(26,3) NOT NULL DSO 30
11 C360_HI_DS090 Signed Number(28,3) DECIMAL(26,3) NOT NULL DSO 90
12 C360_HI_FUTURE Signed Number(28,3) DECIMAL(26,3) NOT NULL Hi Future
13 C360_HI_CURRENT Signed Number(28,3) DECIMAL(26,3) NOT NULL Hi Current
14 C360_HI_OTHERDUE Signed Number(28,3) DECIMAL(26,3) NOT NULL Hi Other Due
15 C360_HI_PAST Signed Number(28,3) DECIMAL(26,3) NOT NULL Hi Past
16 C360_HI_OTHER Signed Number(28,3) DECIMAL(26,3) NOT NULL Hi Other
17 C360_HI_PASTDUE Signed Number(28,3) DECIMAL(26,3) NOT NULL High Past Due
18 C360_HI_WTAVGDAYS Signed Number(28,3) DECIMAL(26,3) NOT NULL Weighted Avg Days Late
19 C360_HI_WTAVGPAID Signed Number(28,3) DECIMAL(26,3) NOT NULL Weighted Avg Paid
20 C360_HI_WTAVGTERMS Signed Number(28,3) DECIMAL(26,3) NOT NULL Hi WTA Avg Terms