Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
salto
Specialist II
Specialist II

Highest value

Hello,

It may sound like a bit silly, but honestly I have not faced this before...

I have four values, each of one is calculated with a different set analysis expression:

Expr1: (sum({<"Date"={"<=$(=date(DateID,'DD/MM/YYYY'))"}>} "Amount")

Expr2: (sum({<"Date"={"<=$(=date(DateID-30,'DD/MM/YYYY'))"}>} "Amount")

Expr3: (sum({<"Date"={"<=$(=date(DateID-60,'DD/MM/YYYY'))"}>} "Amount")

Expr4: (sum({<"Date"={"<=$(=date(DateID-90,'DD/MM/YYYY'))"}>} "Amount")

I need to know which of them has the highest value. It sounds simple but I do not know if there is an function for this in Qlik.

Thanks in advance!

1 Solution

Accepted Solutions
giakoum
Partner - Master II
Partner - Master II

Why not use the RangeMax function?

View solution in original post

9 Replies
sujeetsingh
Master III
Master III

Salto

You can try to get this in two ways one is the sorting of the expression to be expression based and the other way is to have the Dimension as Date and then sort it with the order.

sujeetsingh
Master III
Master III

See this may it help you

salto
Specialist II
Specialist II
Author

Hello sujeetsingh,

thanks for your quick response. I am afraid I do not understand your first suggestion.

I need the maximum value of those four and use it in another Expression that sets the static height of a chart. Something like:

MaxExpr = Max(Expr1, Expr2, Expr3, Expr3);

ChartHeight := 1.25 * MaxExpr;

Thanks again.

salto
Specialist II
Specialist II
Author

Hi sujeetsingh,

Thanks for the example. The main problem here is that there are four values to compare, and building an IF can be too long (but not impossible of course!)

sujeetsingh
Master III
Master III

SALTO actually i was thinking of the making a group expression of the all four and then sort it may it work tryit .

NareshGuntur
Partner - Specialist
Partner - Specialist

May be you can try like this

if(Expr1>Expr2, if(Expr1>Expr3, if(Expr1>Expr4, Expr1, Expr4), if(Expr3>Expr4, Expr3, Expr4)), if(Expr2>Expr3,  if(Expr2>Expr4, Expr2, Expr4),  if(Expr3>Expr4, Expr3, Expr4)))

Cheers,

Naresh

salto
Specialist II
Specialist II
Author

Thanks Sujeet and Naresh,

I will try the Naresh suggests... it seems it can work for my specific problem.

Anyway QV is not letting me compare the values of two variables - time to open another thread.

Cheers!

giakoum
Partner - Master II
Partner - Master II

Why not use the RangeMax function?

salto
Specialist II
Specialist II
Author

Hi Ioannis,

I didn't know this function... sorry! That should be the right way.

It is giving me a problem to use it with variables, I am opning another thread for that,

Thanks a lot!