Very interesting idea. I'm assuming you want to do this in PSQuery/Query Manager...
I just created an ad-hoc query as a quick test. I WAS able to use a number as a default prompt-value and then use that prompt within an expression that performs a calculation. The prompt field type was Number, the field width was 2, and the default value was 10. The expression was Number 2.0, with a text of: 5+(:1). I used that expression as a field. Without entering anything else in the prompt, I ran the query. The result was 15.
I also tried creating a CASE-statement as the default value of a prompt, and then using that prompt within an expression. All that did was return the syntax of the CASE-statement. The statement itself didn't run.
So, this method would work to create defined values which could be embedded within expressions, or used in criteria, or as fields... as long as the defined value isn't complex. Fields and basic numbers work. Dates should as well, but you would have to pay close attention to the default-value syntax as well as the prompt field type and expression field type.
Overall, it would give you a way to easily update your defined constants simply by updating the prompts. That would be better than having to dig through the code every time a defined constant changed. But as always, PSQuery has limitations.
If anyone does find a way to use expressions as the default values of prompts, please let me know ASAP.
------------------------------
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: 03-31-2026 05:11 PM
From: Alex White
Subject: Any way to set variables in expressions in PS query?
You might be able to leverage process parameters, as they are query-able. Sort of depends on the requirements, but works well when you have lists, such as academic programs/plans or item types.
------------------------------
Alex White CBAP
Senior Business Analyst
University of Wisconsin - Madison
------------------------------
Message from the HEUG Marketplace:
------------------------------
Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
------------------------------