2 Replies Latest reply: Nov 7, 2012 4:01 AM by planplan RSS

    sum of specific selected fields?

      Hi

       

      I'm new to Qlikview and are just getting around making some of my first reports and dashboard.

       

      I have a question. How do I get the sum of specific selected fields?

       

      Lets say i have a table like below

       

      Area    Value

      -----------------------

      Asia    10

      US      15

      EU       5

      Africa  50

       

      How can i get a simple listbox which states:

       

      Text                                      Value

      --------------------------------------------------

      EU and Asia (Custom text)   15

      Africa and US (Custom text)  65

       

      Is that possible?

        • Re: sum of specific selected fields?
          Jonathan Dienst

          Hi

           

          You could hardcode this in your expressions or hardcode a calculated dimension but this is usually considered poor practice. I would create a table for your dimension - for example add this to your load script:

           

          CountryGroups:

          LOAD * Inline

          [    

               Area, CountryGroup

               Asia, EU and Asia

               EU, EU and Asia

               Africa, Africa and US

               US, Africa and US

          ];

           

          Now use CountryGroup as the dimenion and Sum(Value) as the expression. If you add further countries, just extend the ContryGroups table accordingly.

           

          Hope that helps

          Jonathan