Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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?

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks jonathan. THis really helped me out

Another user also replied with

=SUM({<Area={'Asia','EU'}>} Value)

=SUM({<Area={'US','Africa'}>} Value)

Thank you all