3 Replies Latest reply: Jun 17, 2011 10:22 AM by Deepak Vadithala RSS

    Variables in set analysis

    Anna Perini

      I have calculated a variable to calculate vC=A/B, now i need to apply this variable inside different tables using set analysis to refine data.

      I've some troubles in sintax like:

       

      =sum({$<COLOR={yellow}, YEAR={2011}>}$(vC)).

       

      Where am I mistaking?

      Thank you

       

      Can

        • Variables in set analysis

          My idea is:

           

          =SUM({$<COLOR = {"yellow"},YEAR = {2011}>}$(vC))

           

          If your values aren't numeric you need to put them in a double quote sign.

          Hope this helps

          • Re: Variables in set analysis
            Deepak Vadithala

            Hi Can,

             

            There are two ways to use variables. I mean the scope of variable changes by adding "=" & not adding "=" at the beginning of the declaration. For example if you declare a variable by pressing (Alt + Ctrl + V) - Variable Overview Window. Something like this...(attached the image)

             

            vSales          Sum (PurchaseAmt)

            vSales2         =Sum (PurchaseAmt)

             

            Both of them looks very similar but they behave differently within QV. I mean vSales works as dollar sign expansion and vSales2 is calculated at the document level and then the value is sent to the object. However, when you are using vSales then the variable is evaluated for every dimension within your object.

             

            In your case, I am assuming that you are using dollar sign expansion (Like vSales in above example). Then you need the below expression.

             

            =sum({$<COLOR={yellow}, YEAR={2011}>} $(=($(vC))))

             

            If this does not work, then please can you post the sample QV document?

             

            Thanks - DV

            VariableOveriew.png