Skip to Content
author's profile photo Former Member
Former Member

Adding a 3rd Possiblity to a Boolen parameter

Not sure if this is the correct wording, but my report was reading from a view {Drivemaster.OpenToPublic} and the only possible values in the column are 0/1 for True/False.

I initially set this report up with a formula to process the parameter:

if {?OpenToPublic} = 'Yes' then {rpt_DriveMaster.OpenToPublic}

else {rpt_DriveMaster.OpenToPublic} = False

And then to display the selected value in the report as:

if {rpt_DriveMaster.OpenToPublic} then 'Yes'

else 'No'

But now they would like to have the parameter modified to select Yes/No/Both so I believe I need to modify the top formula to read:

if {?OpenToPublic} = 'Yes' then {rpt_DriveMaster.OpenToPublic} = True

else if {?OpenToPublic} = 'No' then {rpt_DriveMaster.OpenToPublic} = False

Hopefully this would return all values if Yes/No are not selected.

But I'm not sure if this is correct and then I am not entirely sure how to change the bottom formula to have the selected columns display "All" instead of Yes or No for "Open to the Public"

Suggestions?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 03, 2014 at 04:50 PM

    Hi Trey,

    Make that parameter to Optional prompt, to make optional prompt in the paremeter you need to change the properties of parameter as Optional prompt as "true".

    with the optional prompt if you specify 'yes' it will display those vales, if 'NO' it will display those values, if you didn't specify any values then it will display all values.

    the formula is look like the below

    if (HasValue({?OpenToPublic}) = "Both" then true

    else if {?OpenToPublic} = 'Yes' then {rpt_DriveMaster.OpenToPublic} = True

    else if {?OpenToPublic} = 'No' then {rpt_DriveMaster.OpenToPublic} = False


    Hope the above information will help you.


    --Naga.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Naga,

      I wasn't able to get your formula to work, but I added an additional else to my formula and it appears to be working correctly:

      if {?OpenToPublic} = 'Yes' then {rpt_DriveMaster.OpenToPublic} = True

      else if {?OpenToPublic} = 'No' then {rpt_DriveMaster.OpenToPublic} = False

      else {rpt_DriveMaster.OpenToPublic} = {rpt_DriveMaster.OpenToPublic}

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.