PS Query & SQL

 View Only
  • 1.  Help Writing a Query for a Data Feed

    Posted an hour ago

    Hello Friends,

    We are working on a project where the student account activity details (from the student center) need to be shared with a third-party vendor so they can replicate this detailed summary in their system. 

    I am very new to writing queries for student financials and have been diving into the records and data over the last couple of days. I know that I need to use ITEM_SF and ITEM_LINE_SF, and I can see the matching data (Posted Date, Item, Term, Charge, Payment, Refund). 

    The struggle now becomes how to align the information to the appropriate column, for "Charge", "Payment", "Refund." My experience in PS tells me that there must be some type of code or identifier that I need to tie in to determine how these amounts should apply to the columns. But I don't know where to start with this.

    Any guidance is appreciated.

    SELECT TO_CHAR(B.POSTED_DATE,'YYYY-MM-DD'), B.DESCR, B.ITEM_TERM, B.LINE_AMT
      FROM PS_ITEM_SF A, PS_ITEM_LINE_SF B
      WHERE ( A.BUSINESS_UNIT = B.BUSINESS_UNIT
         AND A.COMMON_ID = B.COMMON_ID
         AND A.ITEM_NBR = B.ITEM_NBR
         AND B.EMPLID = '12345678'
         AND B.ITEM_TERM = '1263')
      ORDER BY 1 DESC



    ------------------------------
    Lidia Anderson
    Manager, Campus Solutions
    Central Washington University
    lidia.anderson@cwu.edu
    ------------------------------
    Alliance 2026 Recordings are here!


  • 2.  RE: Help Writing a Query for a Data Feed

    Posted an hour ago
    Hey Lidia!

    I think the information you're seeking will be found in the ITEM_TYPE_TBL.  The field ITEM_TYPE_CD corresponds to the "classification" area on the SF setup, as shown below:

    image.png

    An ITEM_TYPE_CD of P = Payment, C = Charge, and R = Refund, at least it is at our institution.  I think you if did an outer join of this information to the ITEM_SF table, matching it to the ITEM_TYPE field, then you'll be able to get these indicators.

    I'm no query master though, so I defer to those who are way smarter about this stuff than I am :-).

    -Jamie

    Jamie Pendergrass
    Associate Director
    North Carolina State University
    Office of Scholarships and Financial Aid
    2016 Harris Hall, Box 7302
    Raleigh, NC 27695-7302
    P: 919-515-NCSU (6278)
    F: 919-515-8422



    All electronic mail messages in connection with State business which are sent to or received by this account are subject to the NC Public Records Law and may be disclosed to third parties.



    Alliance 2026 Recordings are here!


  • 3.  RE: Help Writing a Query for a Data Feed

    Posted 58 minutes ago

    Good morning Lidia,

    I'm not sure if your question was just about criteria for determining what the B.LINE_AMT "type" was for each row (Charge, Payment, Refund), or if it was also about report formatting to match the needs of your vendor. I can't help with the first, as I only work in HCM (on the employee payroll/benefits side of Oracle). 

    But I can offer some help if your question is about formatting the report for a vendor.

    For fields that return a value whose purpose or meaning is determined by another field value (ie. a $$$ amount that corresponds to a specific type of Charge or Earn_Code, etc), where you cannot simply add a "Description" column, you can use the field in a CASE expression and return that expression as a field.

    For example:

    (CASE

    WHEN C.ITEM_TYPE_CD = 'P'

    THEN B.LINE_AMT

    ELSE ' '

    END)

    AS Payment

    When used as a field, this expression would result in a column titled "Payment" where the $$$ amounts are only payments. You would then create additional expressions where C.ITEM_TYPE_CD was equal to C, R, etc. (assuming that's correct) and use those as fields to create their respective columns. I don't know the SQL for setting the field type or width for an expression since I normally work in PSQuery. But I'm sure someone else in the community can help with that part if you need it.

    Hope this helps,

    Scott Frey

    Senior Data Analyst-HRIS, Employee Services

    University of Colorado

    1800 Grant Street, Suite 400

    Denver, CO  80203

    t  303 860 4200

    Scott.Frey@cu.edu
    www.cu.edu

    A black text on a white background

AI-generated content may be incorrect.



    ------------------------------
    Scott Frey
    Senior Data Analyst - Human Resource Information Systems
    University of Colorado System
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Alliance 2026 Recordings are here!