6 Replies Latest reply: Nov 15, 2010 4:55 AM by Logesh Jayaraman RSS

    = in the expression

    Logesh Jayaraman

      Hi ,

      I have noticed the expression are prefixed with = symbol and some expressions are not prefixed with =. Is there will be any difference if we are using prefix = and not prefix =. Please suggest.

        • = in the expression
          Miguel Angel Baeyens de Arce

          Hi,

          When you set an expression in the expression dialog box, then there is no need to use the "=" sign, as this is what QlikView is expecting. Setting the "=" before the actual expression will make no difference. But in some cases you want something to be evaluated as an expression, then you prefix it with the "=" sign.

          For instance, say you want to display an expression in a text object, or within the caption of a chart, then you will need the "=" sign:

           

          ='Grand Total: ' & Sum(Amount)


          You can check the expressions in the Settings menu, "Expression Overview" (NOTE: use this dialog with caution, since you can change expressions from here). You will see here a double == before those expressions that didn't need a preceding "=" but have one.

          Hope that helps.

          • = in the expression
            Steve Dark

            Hi there,

            Incidentally, there is a big difference between using the equals in front of expressions in variables. With an equals sign QlikView will re-evaluate the expression on any change (potentially a big resource drain) and using the variable will return the result of the expression. Without the equals sign the expression is not evaluated and the code is returned when the variable is used - this means it is evaluated where it is used.

            The main visible difference of this is if an expression is used in a variable on a chart with a dimension. With an equals in front of the expression in the variable the same value will be returned for each dimension (as it is evaluated at application level), whereas if the variable does not have an euqals then it is evaluated separately for each dimension - thus giving a different answer.

            Hope that makes sense.

            Regards,
            Steve