Skip to main content
ExLibris
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    Using Conditionals in Voyager Prepackaged Access Reports

    • Product: Voyager
    • Relevant for Installation Type: Multi-Tenant Direct, Dedicated-Direct, Local, TotalCare

     

    Question

    Provide some tips for using Conditionals in Voyager Prepackaged Access Reports. 

    Answer

    Sometimes you might want your results to vary, based on some criterion. This is called a "Conditional".

    In a programming language, a Conditional might look something like this:

    if (sun is up) then
        “day”;
    else
        “night”;

     

    IIf() Function

    The IIf() Function ("Immediate IF") allows for conditionals in Voyager Prepackaged Access Reports.

    Format:  IIf (expr, truepart, falsepart)

    If the expression, “expr” turns out to be true, the value of IIf is “truepart”. If the expression is not true, the value of IIf is “falsepart”.

    Example: PH: IIf([PATRON_PHONE].[PHONE_NUMBER] Is Null,"NO PHONE",[PATRON_PHONE].[PHONE_NUMBER])

    In the above call example, we want the phone number associated with each patron's permanent address.  A phone number is not required, however, so we use an outer join, then we use an IIf() function to put "NO PHONE" in the results if there is no phone number.

    clipboard_e7e943afb4032d61f89c88c6902072b01.png

     

    clipboard_e2ca6fa2bbd8350be6c24c4b5fdb1f36a.png

     

    Constructing custom SQL queries by request and troubleshooting unexpected results from customer-created SQL queries falls outside the scope of Support. The above has been posted for informational purposes.  Voyager-L and Developer Network are useful resources for finding helpful custom SQL or obtaining assistance from peers in troubleshooting custom queries.

     


    • Article last edited: 03-Mar-2021