Calculating the lowest or highest value in a range

It is quite often useful for us to calculate the lowest or highest value in a range. There are possibilities to do this using AGGR, but within a chart we can also make use of the Range functions along with some of the chart inter-record functions, such as Above, Below, Before, After, First, Last, and so on.

In this recipe, we are going to calculate the highest and lowest values in a range so that we can assign a relative color to them using the ColorMix1 function.

Getting ready

Load the following script:

LOAD * INLINE [
    Country, Sales
    USA, 1100
    Mexico, 650
    Canada, 709
    UK, 932
    Germany, 800
    France, 777
    Australia, 537
    Japan, 898
    Russia, 687
];

How to do it…

Follow these steps to find out how to calculate ...

Get QlikView for Developers Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.