Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Custom Sequential Classes for a Map

Folks,

I have a map showing values by UK Postcode (area or district depending on selections).  A few of my values are very big, and then fall away sharply, so I don't really want to use the standard sequential classes as the middle isn't really used.

I have created an expression for colouring like so (choice of two metrics - lives or sum assured), but I have hard coded the boundaries:

if(if([Metric]='Lives',sum([LIVES]),sum([TSA]))<10000000,rgb(255,255,204), 

if(if([Metric]='Lives',sum([LIVES]),sum([TSA]))<50000000,rgb(255,237,160),  

     if(if([Metric]='Lives',sum([LIVES]),sum([TSA]))<100000000,rgb(254,217,118),

         if(if([Metric]='Lives',sum([LIVES]),sum([TSA]))<500000000,rgb(254,178,76),

             if(if([Metric]='Lives',sum([LIVES]),sum([TSA]))<1000000000,rgb(253,141,60),

     if(if([Metric]='Lives',sum([LIVES]),sum([TSA]))<5000000000,rgb(252,78,42),

      if(if([Metric]='Lives',sum([LIVES]),sum([TSA]))<10000000000,rgb(227,26,28),

       if(if([Metric]='Lives',sum([LIVES]),sum([TSA]))<25000000000,rgb(189,0,38),rgb(128,0,38)

                           ))))))))

What I really want to do is set the boundaries as a % of the highest amount in a postcode.  Everytime I try something it calculates the maximum for THAT particular postcode and therefor sets the colour based on 100% of the maximum.

Any ideas?

Many thanks in advance for the help.

Cheers

Chris

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Ok, then replace the hardcoded values with a % multiplied by the max:

     0.2 * $(=max(aggr(sum( ...), Dim1, Dim2, ..., DimN)))

Replace Dim1, Dim2, ..., DimN with whatever dimensions the sum should be aggregated over.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Ok, then replace the hardcoded values with a % multiplied by the max:

     0.2 * $(=max(aggr(sum( ...), Dim1, Dim2, ..., DimN)))

Replace Dim1, Dim2, ..., DimN with whatever dimensions the sum should be aggregated over.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Many thanks - that works a treat....

Cheers

Chris