Thanks for providing the character limit for the prompts Scott. I'm always learning from you.
To be honest, I don't know if there is an advantage to the REGEXP_
I haven't used this expression in a few years.
I just remembered having it in my "bag of dirty tricks and hacks" and thought I'd throw it out here in case anyone can benefit from it.
...it's probably something I learned at Alliance.
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

Original Message:
Sent: 11/13/2025 12:23:00 PM
From: Scott Nishizaki
Subject: RE: What's your favorite expression, case statement, trick?
I think the posts may renumber themselves if one of us adds a reply to a "higher up" post.
We've utilized this prompt method before, and agree that INSTR(:1, A.EMPLID) > 0 is the only way we've found to allow this. Calling this a "limited number" is a bit unfair since a PS Text prompt can handle 4,000 characters (this is the PS universal limit for a Char vs CLOB) So even if you're doing 'EMPLID1', 'EMPLID2',... you could get at least 266 IDs (assuming you use all 11 characters in EMPLID).
@Scott Frey, I'm wondering why you use REGEXP_INSTR(...) rather than INSTR(...). Is there an advantage to this?
------------------------------
Scott Nishizaki
Connected Campus Community of Practice
Developer/Analyst
Azusa Pacific University
------------------------------
Message from the :
------------------------------
Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the .
------------------------------
Original Message:
Sent: 11-13-2025 10:32 AM
From: Scott Frey
Subject: What's your favorite expression, case statement, trick?
Good morning Bob & Kendall,
I wasn't able to locate Post #44 in my blizzard of emails, so I apologize if this is redundant.
I use the following INSTR expression and criteria. As previously mentioned, this method is limited by the field width of PSQuery prompts, and by the character-count of whatever field you're using in the prompt. Prompt values are comma-space separated when entered, e.g.
XXXXX1, XXXXX2, XXXXX3, XXXXX4, etc.
In this example, I'm prompting for EmplID. Univ. of Colorado uses 6-digit EmplIDs, and I think I can search five at a time. I don't use this option very often. My customers are usually FAs. But it does have its applications.
(CASE
WHEN REGEXP_INSTR(:1, A.EMPLID) > 0
THEN A.EMPLID
END)
=
A.EMPLID
------------------------------
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.
Original Message:
Sent: 11-13-2025 06:26 AM
From: Robert Fogarty
Subject: What's your favorite expression, case statement, trick?
Kendall,
The only way that I have been able to add a list through a prompt is using INSTR as detailed in post #44 of this thread
Bob
--
Bob Fogarty
LionPATH - Reporting Team Lead
The Pennsylvania State University
Original Message:
Sent: 11/12/2025 4:43:00 PM
From: Kendall Vance
Subject: RE: What's your favorite expression, case statement, trick?
Speaking of ANY()/ALL(), does anyone know if it is possible to use a prompt to pass the list of values. I've tried a few things, but nothing worked.
So, Instead of ANY('11111111','22222222',...), something like ANY(:1). Can it be done?
------------------------------
Kendall Vance
IT Technical Associate for Financial Aid Reporting
Northern Illinois University
------------------------------
Message from the HEUG Marketplace:
------------------------------
Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
Original Message:
Sent: 11-04-2025 12:29 PM
From: Robert Fogarty
Subject: What's your favorite expression, case statement, trick?
The complimentary expression for not in list is
<> ALL('10000001','10000002','1000003')
Bob
--
Bob Fogarty
LionPATH - Reporting Team Lead
The Pennsylvania State University
Original Message:
Sent: 11/4/2025 12:23:00 PM
From: Morgan Andres
Subject: RE: What's your favorite expression, case statement, trick?
I use this all the time and have screamed it from the rooftops at my university, but I learned it from Robert Fogarty at Alliance a couple years ago. It would have been such a great tool when implementing for testing.
Morgan Andres
Senior Business Systems Analyst
Student Information Services and Systems (SISS)
Duke University
1121 West Main St., Suite 2200
Durham, NC 27701
E-mail: morgan.andres@duke.edu
Original Message:
Sent: 10/30/2025 12:16:00 PM
From: Timothy Krug
Subject: RE: What's your favorite expression, case statement, trick?
I love this one, and I learned it from you, Scott! But then at this year's Alliance, I mentioned it, and some delightful soul (whose name I have shamefully forgotten....please identify yourself if you're reading this!) told me you can use "ANY" instead to make it simpler. All you have to do is set EMPLID = [an expression]. The expression text is ANY('10000001','10000002','1000003') except of course you use real EMPLIDs. Then you can skip the "and 1 = 1" bit!

------------------------------
Timothy Krug
Consulting Manager
Huron Consulting Group
Original Message:
Sent: 10-30-2025 12:02 PM
From: Scott Cho
Subject: What's your favorite expression, case statement, trick?
My favorite is the sly way you can add a list of EMPLID's from an expression.
What you do is manually add a test like this and finish it off with the statement: AND '1'
A.EMPLID IN ('12345', '12354', '45678')
AND '1'
Then you add it to your criteria and make it equal to 1:

This "tricks" the system into thinking this is two lines of criteria:
SELECT A.EMPLID, A.AID_YEAR
FROM PS_STDNT_AID_ATRBT A
WHERE ( A.EMPLID IN ('12345', '12354', '45678')
AND '1' = '1')
This trick has saved me from having to enter 200 EMPLID's for a query and instead I can grab them from a text editor/spreadsheet and get what I want.
Scott Cho
PeopleSoft Campus Solutions Consultant
630/384-9711
Original Message:
Sent: 10/30/2025 11:54:00 AM
From: Dana Pawlowicz
Subject: What's your favorite expression, case statement, trick?
What's your favorite trick, case statement, expression in SQL (or PS Query)? If you have a favorite trick (or treat), please share it!
Mine is still the one that Jeffrie Brooks shared in a FA post awhile back to get your sum totals to stop multiplying by the number of rows of data coming back. I've been using it ever since and I LOVE it. Thank you, Jeffrie!
SUM(A.OFFER_AMOUNT)*COUNT(DISTINCT A.EMPLID || A.INSTITUTION || A.AID_YEAR || A.ITEM_TYPE || A.ACAD_CAREER)/COUNT(*)
Since this was on a different forum, I'm copying Jeffrie's total response below instead of linking to the post:
So this solution is a bit unconventional but it has worked for me for a couple years now with our FA tables.
As you mentioned the amounts are multiplied by the number of rows being rolled up by the aggregate, so what we need to do is come up with the math that divides it by that same number again. After quite a bit of work, I came up with the following statement that seems to accomplish this for us. This example uses STDNT_AWARDS - which is important because the KEY fields play a big role in this.
SUM(A.OFFER_AMOUNT)*COUNT(DISTINCT A.EMPLID || A.INSTITUTION || A.AID_YEAR || A.ITEM_TYPE || A.ACAD_CAREER)/COUNT(*)
So what is it doing? Its taking the SUM that you've been stuck with and DIVIDES that number by each row in the QUERY - - - "/COUNT(*)"
That number actually ends up being too small. So we need to take that number and multiply it by the distinct key fields that are on the table that we want the SUM. - - - *COUNT(DISTINCT A.EMPLID || A.INSTITUTION || A.AID_YEAR || A.ITEM_TYPE || A.ACAD_CAREER). The result should be what you are looking for.
With different tables, you just replace the concatenated KEY fields.
For STDNT_AWRD_DSB, the expression becomes: SUM(A.OFFER_BALANCE)*COUNT(DISTINCT A.EMPLID || A.INSTITUTION || A.AID_YEAR || A.ITEM_TYPE || A.ACAD_CAREER || A.DISBURSEMENT_ID)/COUNT(*)
For STDNT_CAR_TERM it could look like SUM(A.UNT_TAKEN_PRGRSS)*COUNT(DISTINCT A.EMPLID || A.INSTITUTION || A.ACAD_CAREER || A.STRM)/COUNT(*)
It has worked really well as a work-around for me, with these tables and in our system. I would strongly recommend validating the data when you run it, especially if you are trying to apply this solution to other tables.
------------------------------
Dana Pawlowicz
Business Systems Analyst Sr - ERP
University of Cincinnati
------------------------------
Message from the HEUG Marketplace:
------------------------------
Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
------------------------------