4 Replies Latest reply: Nov 29, 2017 10:22 AM by Marcus Sommer RSS

    AND/OR operation in Parameterized Set Analysis

    Some Nath Roy

      Hi,

      Have created a variable as:

      vParam=Sum({<$1,$2,$3>+<$4,$5,$6>} Sales_Vol)

       

      Now in one of a chart object, would like to use this variable by passing 1st, 2nd parameter with first set and 4th parameter with second set.

      For an example, like to show sales volume of current year having active_ flag = 1 OR sales of last year.

       

      How is to pass these parameters while using in chart expression ?

       

      I am using an work around as:

      $(vParam(CY={1},active_flag={1},active_flag={1},LY={1}))

       

      To place LY={1} in appropriate set, I am using active_flag={1} twice.


      Is there any other better approach? If the number of parameters are high, this approach would not be useful.


      Thanks,

      som

        • Re: AND/OR operation in Parameterized Set Analysis
          Some Nath Roy

          The below syntax is also working for QV 11.


          $(vParam(CY={1},active_flag={1},$3,LY={1}))

          • Re: AND/OR operation in Parameterized Set Analysis
            Marcus Sommer

            There maybe use-cases where such parametrized variables have a benefit but as a more general approach it's just dividing the work to two places without reducing the complexity. Rather the opposite will be happens - the readability will be poorer and you get problems if you want to use multiple values or expressions within your parameters.

             

            Therefore I would probably just use "simple" expressions which contain all of the conditions.

             

            - Marcus

              • Re: AND/OR operation in Parameterized Set Analysis
                Some Nath Roy

                Hi Marcus,

                 

                Thanks for your reply. Yes I am agree with you of using simple expressions.

                 

                But for some business scenarios I am trying to generalize a list of expressions that can be used in multiple dashboard apps. In such use-cases just trying to incorporate the common business requirements.

                 

                Not only the readability of the expressions, but also the performance hit needs to be checked.

                 

                Regards,

                som

                  • Re: AND/OR operation in Parameterized Set Analysis
                    Marcus Sommer

                    In this case it might be more useful to maintain the variables with their expression-content externally maybe within Excel. Within this posting: Variables are several links how this could be done.

                     

                    From a performance point of view there is no difference if an expression is directly written or if variables contain the expressions (unless the expressions are slightly different - beginning with an equal sign or not, different number of spaces or brakets and so on are creating a different hash of the expressions and they couldn't be cached together).

                     

                    - Marcus