PS Query & SQL

 View Only
Expand all | Collapse all

Any way to set variables in expressions in PS query?

  • 1.  Any way to set variables in expressions in PS query?

    Posted 6 days ago

    I'm probably just fantasizing here but is there anyway to hardcode a variable in an expression and reference it later? Or in a query and reference it in an expression? I have a really complex expression I have to update somewhat frequently, it would save me a lot of time to just declare them at the top of an expression and change them there.

    Would the only way to accomplish what I'm thinking of be to set Prompts with default values, then reference the prompts in the expression?

    Just thinking out loud after a long day, thanks,

    John



    ------------------------------
    John Royal
    Program Manager II, Systems and Loans
    Wake Forest University School of Medicine
    ------------------------------

    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 coming soon!


  • 2.  RE: Any way to set variables in expressions in PS query?

    Posted 6 days ago

    Can you provide more concrete details?  Can you provide an example of the expression you are thinking of?



    ------------------------------
    Daniel Labrecque
    Oracle Consulting Manager
    Huron Consulting Group
    ------------------------------

    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 coming soon!


  • 3.  RE: Any way to set variables in expressions in PS query?

    Posted 5 days ago

    The query I'm thinking of has a huge expression that compares scholarship amount to leftover need then puts them in various tiers to assist in awarding. The need minimum and maximum and scholarship minimum for each tier are all hardcoded right now and when they're updated it's a big pain. It sounds like prompts would be the simplest way to do this - I was wondering if there was a way to define variables in the expression itself and that doesn't seem possible.



    ------------------------------
    John Royal
    Program Manager II, Systems and Loans
    Wake Forest University School of Medicine
    ------------------------------

    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 coming soon!


  • 4.  RE: Any way to set variables in expressions in PS query?

    Posted 6 days ago

    If I'm understanding what you are asking: Yes, I use prompts in query expressions all the time. You do have to set up the prompt first the data type. Then go back to your expression and insert the prompt wherever you need one of your currently hard-coded values to be a variable.

     

     

    Lynn Hutchins
    IT – Business Analyst
    Information Services
    lynn.hutchins@cwu.edu

     

     

     

     




    Alliance 2026 Recordings are coming soon!


  • 5.  RE: Any way to set variables in expressions in PS query?

    Posted 5 days ago

    Thanks! That sounds like the simplest way to accomplish what I'm trying to do for now.



    ------------------------------
    John Royal
    Program Manager II, Systems and Loans
    Wake Forest University School of Medicine
    ------------------------------

    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 coming soon!


  • 6.  RE: Any way to set variables in expressions in PS query?

    Posted 6 days ago

    John,

    I'm interested to see an example of what you have in mind, but I have worked on queries with monstrous (and repeated) expressions that do refer to prompts with default values. It's ugly, but easier than updating a large number of expressions and trying to keep everything synced up.

    I'm not aware that PS Query supports the creation of variables like you're asking. However, Michael Williams at UConn gave a presentation at Alliance 2025 called "Prompt and Circumstance" in which he described tying variables in queries to the Field Conversion Definition tables. That's a place where you can save variables with field names and values in a static place, then make updates as you see fit. It takes some setup, but he demonstrated it as a way to update the references in an unlimited number of queries all at the same time (e.g. save all your odd year values and your even year values in one place, update the references when it's time, and now all your "odd" queries go from 2025 to 2027). That might scratch the itch you're describing!



    ------------------------------
    Timothy Krug
    Consulting Manager
    Huron Consulting Group
    ------------------------------

    Alliance 2026 Recordings are coming soon!


  • 7.  RE: Any way to set variables in expressions in PS query?

    Posted 5 days ago

    Woah that's huge! I'll take a look at that presentation. Thanks!



    ------------------------------
    John Royal
    Program Manager II, Systems and Loans
    Wake Forest University School of Medicine
    ------------------------------

    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 coming soon!


  • 8.  RE: Any way to set variables in expressions in PS query?

    Posted 5 days ago

    Hi Timothy,

    Can you point me to the session you are referring? I looked but can't find it. Unless the presentation didn't get recorded and/or the power point wasn't posted.

    Thanks,

    Lara



    ------------------------------
    Lara Couture
    Marquette University
    ------------------------------

    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 coming soon!


  • 9.  RE: Any way to set variables in expressions in PS query?

    Posted 5 days ago

    Hm... it looks like there's an issue accessing the 2025 materials. I'd expect to see them here https://www.heug.org/resources/heug-files/a25-files, but it's taking me to a page to buy an on-demand pass for 2026 instead. I've sent an email to support.



    ------------------------------
    Timothy Krug
    Consulting Manager
    Huron Consulting Group
    ------------------------------

    Alliance 2026 Recordings are coming soon!


  • 10.  RE: Any way to set variables in expressions in PS query?

    Posted 4 days ago

    Hey All - I was able to get to the Prompt and Circumstance presentation.  Here is what I did.

    I used the following URL to get to the Alliance Mobile site.  https://events.rdmobile.com/Home/Details/117 

    1. After clicking the link, click the Login link in the upper right corner.  
    2. Add your email address.Click the Login button. 
    3. You will receive a email with a link in it. 
    4. Click the link, and you will be logged into the mobile Alliance site. 
    5. Click the Continue button. 
    6. Click the All Events link. 
    7. Choose the conference 
    8. Use the navigation pane on the left side of the page to find presentations, presenters, etc. 
    9. I have found searching for the Presenter the easiest way to find a presentation. 


    ------------------------------
    Tom Johnson
    Sr Business Systems Analyst
    Duke University
    tom.johnson@duke.edu
    "None of us is as smart as all of us"
    ------------------------------

    Alliance 2026 Recordings are coming soon!


  • 11.  RE: Any way to set variables in expressions in PS query?

    Posted 4 days ago

    I think likely the difference is whether or not you attended Alliance 2025.  I know that Tom did, so that he has access is not surprising.  For those that did not attend, I believe the Alliance '25 recordings will become public soon (month or two at the most).   



    ------------------------------
    Scott Nishizaki
    Connected Campus Community of Practice
    Developer/Analyst
    Azusa Pacific University
    ------------------------------

    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 coming soon!


  • 12.  RE: Any way to set variables in expressions in PS query?

    Posted 6 days ago

    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.
    ------------------------------

    Alliance 2026 Recordings are coming soon!


  • 13.  RE: Any way to set variables in expressions in PS query?

    Posted 5 days ago

    Hey Alex would you mind expanding on that? Are you talking about a specific page in PS? Quick google didn't make it clear to me - thanks!



    ------------------------------
    John Royal
    Program Manager II, Systems and Loans
    Wake Forest University School of Medicine
    ------------------------------

    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 coming soon!


  • 14.  RE: Any way to set variables in expressions in PS query?

    Posted 5 days ago

    We created a custom page where we can enter a process parameter and translate value by aid year. The query record for this page was added to our query tree so we can use this value in multiple queries or equations and then just change variable in one place. Below is an example of our registrar's document fee amount, which changes every few years and is referenced in queries and equations. So we just need to change the value in one place. We also use this page to enter a series of values and their cross reference value, such as private alternative loans and their destination numbers. 



    ------------------------------
    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.
    ------------------------------

    Alliance 2026 Recordings are coming soon!


  • 15.  RE: Any way to set variables in expressions in PS query?

    Posted 5 days ago

    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.
    ------------------------------

    Alliance 2026 Recordings are coming soon!


  • 16.  RE: Any way to set variables in expressions in PS query?

    Posted 5 days ago

    Hi guys, the summer session of my presentation was open to everyone I'll attach that and the example SQL. 



    ------------------------------
    Michael Williams
    Systems Analyst
    University of Connecticut
    ------------------------------

    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 coming soon!


  • 17.  RE: Any way to set variables in expressions in PS query?

    Posted 5 days ago

    Much appreciated. I forgot about the Summer Series. I'll make sure to look at those materials as well. I'm new to Financial Aid and really appreciate that presentations are available to those that were unable to attend the conferences.

    Lara



    ------------------------------
    Lara Couture
    Marquette University
    ------------------------------

    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 coming soon!