New to QlikView

Discussion board where members can get started with QlikView.

New Contributor III

Mark only highest value under a limit - background color expression

Hi,

Is it possible to mark the highest number under a limit? (background color expression)

Lets say you have a bunch of different numbers:

500,

452,

2,

35,

816

How do I mark the highest number under ley say 480 (=452) without marking all the numbers under the “limit” ?

I have tried some stuff with the max and maxstring, but no luck when it’s under a limit.

If(Test<='480',LightBlue(),)     //<-- Marks all equal to or under

if(max(Test)<= '480',LightBlue(),)      //<--do not work – makes sense since the max value is not under

If(Test<='480',if(Test=max(Test),LightBlue(),),)      //<--Do not work

if(Test< =max(If(Test <='480', Test,)),LightBlue(),)      //<--Do not work

Labels (4)

14 Replies
Contributor

Re: Mark only highest value under a limit - background color expression

Try this

If(Rank(YourExpression) = 1,Blue(), Green())

While we teach we learn
New Contributor III

Re: Mark only highest value under a limit - background color expression

Thats pretty cool 🙂 Marks all rows above one color and equal to or under another color.

However in this case I would like to only mark one row (max string under the limit).

Contributor

Re: Mark only highest value under a limit - background color expression

would this work

If(Rank(YourExpression) = 1,Blue())

While we teach we learn
New Contributor III

Re: Mark only highest value under a limit - background color expression

I guess I'm using it the wrong way.

How would you make it work, to just highlight one (highest within the limit)? Could you give me an example?

Right now I'm marking all - either above or under the limit.

MVP

Re: Mark only highest value under a limit - background color expression

``If(Max(TOTAL {<Test = {"<480"}>} Test) = Test, LightBlue())``

New Contributor III

Re: Mark only highest value under a limit - background color expression

Maybe... 🙂

I get red lines under the part starting with {"<480"}

If(Max(TOTAL {<Test = {"<480"}>} Test) = Test, LightBlue())

MVP

Re: Mark only highest value under a limit - background color expression

I hope you have used the correct field name as I think Test is just a placeholder? There are three Tests that need to be replaced by your field name....

New Contributor III

Re: Mark only highest value under a limit - background color expression

You are right. It's just a name since I cannot share any of my real data.  I did change it to the right one. It is "accepted" right before the {"<480"} part..  and yes all 3 parts was changed to the correct name 🙂

Also tried to create a new with the actual name "Test" (just to be sure) = still the same red lines.

However - it is the name (or label if you will) of the expression, and not a table field name. Do not know if that changes anything.

This it what It looks like in the expression:

Would think it to be some syntax-thing. 🤔

Highlighted
MVP

Re: Mark only highest value under a limit - background color expression

Yes, it def. does. You cannot use expression labels... you need to use the fields created in the script to do this.