Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
Why not use the RangeMax function?
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.
See this may it help you
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.
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!)
SALTO actually i was thinking of the making a group expression of the all four and then sort it may it work tryit .
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
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!
Why not use the RangeMax function?
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!