# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Rules, plus terms and conditions, can be found here.
Not applicable

## Bar Graph Dimension based on Calculated Percent of a Sum

How do I make a bar graph dimension based on a calculated percent of a Sum?

For example, if I have:

Continent  Country  Medals  Attempts

NorthAM    US          10         20

Europe       Spain      3          12

Europe       France    3          6

Asia            Russia   10        15

I would like to show the number of CONTINENTS that have under 50% medals/attempts in red compared to under 75% in Yellow and over 75% green.

In my example:

NorthAm would be 15/25 = 60% (Yellow)

Europe would be 6/18 = 33% (Red)

Asia would be 10/15=66% (Yellow)

So my bar graph should show:

Yellow:  2

Red:  1

I've been playing with creating multiple expressions like this, with no luck:

=COUNT(DISTINCT if(SUM(TOTAL <Continent> Medals)/SUM(TOTAL <Continent> Attempts)<.5,Continent))