7 Replies Latest reply: Jul 19, 2013 9:06 AM by lionel925 RSS

    Set analysis writing

      Hello

       

      I am strugling a little bit with a set analysis formula.

       

      I am placing bubble on a chart. The Y axis can be selected using a "cyclic group "

      The X axis is based on a static dimension

       

      I would like the bubble size to correspond to the pourcentage of the record of the columns

       

      Something like Sum( X,Y)/Sum (X)

       

      I am trying to use a set analysis to calculate the sum X but it's not working

       

      • UTS = name of the group
      • NB_Xtrem = name of the metrics
      • sum( {<$(=GetSelectedField(UTS))=  >} NB_Xtrem);

       

       

      sum( {<$(=GetSelectedField(UTS))=  >} NB_Xtrem);

      the last } in red is underlined in red in qlikview

       

      Must be stupid but I can't find the solution.

       

      Lionel

        • Re: Set analysis writing
          Tresesco B

          Try:

           

          getcurrentfield( YourGroup )

           

          sum( {<$(=GetCurrentField(UTS))=>} NB_Xtrem)

           

          This should work.

            • Re: Set analysis writing

              Thanks for the reply

               

              I getting a result now but it seems that the selection is still applied

               

              i have created 2 metrics,

              • sum(NB_Xtrem)
              • sum( {<$(=GetCurrentField(UTS))=>} NB_Xtrem)

              And they are giving the same value for a given bubble.

               

              I would have expected the last one to be the same for all the bubbles of a given value of the X axis (UTS in on the Y axis).

               


            • Re: Set analysis writing

              Thanks to "Tres qv" i have made some progress.

               

              the getCurrentField instruction is working, I can see in a text box that the correct field is listed.

               

              But i am still facing an issue, the set analysis doesn't seems to work as I obtain the same value for the 2 metrics (see above)

               

              Any idea ?

              • Re: Set analysis writing
                jagan mohan rao appala

                Hi,

                 

                You can try the if statement like this

                 

                If(GetCurrentField(UTS) ='Dimension1', Sum({<Dimension1=>} TOTAL NB_Xtrem),

                     If(GetCurrentField(UTS) ='Dimension2', Sum({<Dimension2=>} TOTAL NB_Xtrem),

                     '

                     '

                     '

                     '

                Hope this helps you.

                 

                Regards,

                Jagan.

                • Re: Set analysis writing
                  Celambarasan Adhimulam

                  Hi,

                   

                  In Set analysis you can only use field names as a Set Modifier. Here your expression has functions which is not possible. Please Go with jagan mohan suggestion.

                   

                   

                  Even you cannot use {'1'}={'1'} in set analysis like we are doing in sql.

                   

                  Regards,

                  Celambarasan

                  • Re: Set analysis writing

                    Finaly based on Jagan proposal i have solved the issue with variables.

                     

                    As the number and value of the X axis are predefined and limited (10) i have created one variable per value of the X axis, each of them dynamcally calculated

                     

                    I can then in the bubble chart use a test to divide the value of each bubble of a given value of the x axis by the  cumulated value of all the bubbles for the same value of the x axis (stored in a varible)

                     

                    Thanks