6 Replies Latest reply on Sep 19, 2016 4:53 AM by Paul Collins

    Parameter control Boolean expression error

    Paul Collins

      I am trying to do something that should be simple.

      Use a PARAMETER control to filter a DIMENSION on multiple sheets on the same dashboard

       

      PARAMETER name is [COC NAME]

      DIMENSION name is [COC]

       

      Note: in the picture below I have not typed the END statement as it then underlines everything in red and returns the error "cannot use boolean type in IF expression"

       

       

      Help please ?

        • 1. Re: Parameter control Boolean expression error
          Steven Carter

          Hi Paul,

           

          You'll need to drop the "[COC]=" portion, and then it should work.

           

          Regards,

          Steven

          • 2. Re: Parameter control Boolean expression error
            Steven Carter

            Sorry, I didn't read fully....try something like this...

             

            IF [COC_NAME] = 'POWERTRAIN' AND [COC] = 'PT' THEN 'True'

            ELSEIF....

            ELSE 'False'

            END

             

            If you want a TRUE boolean value and not just a string, do this...

             

            ([COC_NAME = 'POWERTRAIN' AND [COC] = 'PT') OR

            ([COC_NAME = 'EESE' AND [COC] = 'EESE')

             

             

            This will return TRUE or FALSE as a boolean.

            • 3. Re: Parameter control Boolean expression error
              Andrew Watson

              Looks like you want your parameter to mirror your dimension. In which case you can make your parameter values equal to your dimension values, which seems to be the case for all apart from Powertrain. Then create a calculated field [COC NAME] = [COC], drag it to the filters and set to True.

               

              Depending on what you're actually trying to do you could just use the dimension as a standard filter. You can make this filter apply across multiple sheets of the same dashboard.

              • 4. Re: Parameter control Boolean expression error
                Paul Collins

                Thank you Andrew,

                Cant believe it was a simple as that.

                 

                Slight development though.

                I  have an 'ALL' parameter in my parameter selections, which I would like to use to select everything when I dont have an individual one selected.

                ALL

                POWERTRAIN

                EESE

                BODY

                CHASSIS

                SVO

                OTHER

                 

                How would I make that work ?

                 

                Thanks again

                Paul.

                • 5. Re: Parameter control Boolean expression error
                  Andrew Watson

                  Try:

                   

                  IF [COC NAME] = 'ALL' THEN 'true'

                  ELSEIF [COC NAME] = [COC] THEN 'true'

                  ELSE 'false'

                  END

                   

                  Hopefully that'll do the job

                  • 6. Re: Parameter control Boolean expression error
                    Paul Collins

                    Sorted this in the end using SETS and the CASE statement:

                     

                    Created a SET for all items

                    Then a SET for each of the single selections

                     

                    PARAMETER called [COC NAME] with

                    'ALL

                    POWERTRAIN

                    EESE

                    BODY

                    CHASSIS

                    SVO

                    OTHER

                     

                    Calculated field in filter pane: "In" selected

                     

                    Case [COC NAME]

                        When "ALL" Then

                            IF [ALL_COC] THEN "In" ELSE "Out" END

                        When "POWERTRAIN" Then

                            IF [POWERTRAIN_set] THEN "In" ELSE "Out" END

                        When "EESE" Then

                            IF [EESE_set] THEN "In" ELSE "Out" END

                        When "BODY" Then

                            IF [BODY_set] THEN "In" ELSE "Out" END

                       When "CHASSIS" Then

                            IF [CHASSIS_set] THEN "In" ELSE "Out" END

                       When "SVO" Then

                            IF [SVO_set] THEN "In" ELSE "Out" END

                       When "OTHER" Then

                            IF [OTHER_set] THEN "In" ELSE "Out" END

                    End

                     

                    Thanks to everyone who helped contribute. Got there in the end.