Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

How to select the maximum value in an expression in a filed in qlik sense

Hello

I have a field which called PERIOD , I would like to ONLY choose the maximum value (or the last value) of that filed automatically

How I do it in the Field expression

Capture.JPG

7 Replies
MVP
MVP

Re: How to select the maximum value in an expression in a filed in qlik sense

Are you talking about using the max value in aggregations in your expression, i.e. we may talk about using set analysis?

Then try maybe

=Sum({<PERIOD = {'$(=Maxstring(PERIOD))'}>} Value)

Not applicable

Re: How to select the maximum value in an expression in a filed in qlik sense

You can try like these

Maybe it  should work

sum({<PERIOD = {"$(=max(PERIOD))"}>}value)


Thanks,

Bob

Not applicable

Re: How to select the maximum value in an expression in a filed in qlik sense

Hi Stefan

Thanks for your replay but my period variable are NUMERIC

Not applicable

Re: How to select the maximum value in an expression in a filed in qlik sense

Worked, thanks a lot

MVP & Luminary
MVP & Luminary

Re: How to select the maximum value in an expression in a filed in qlik sense

Afaik you can't automatically select a value yet in Qlik, Sense. There's no OnOpen trigger like in Qlikview. What you can do is change your chart expression so that by default they calculate the result for the maximum PERIOD value. When nothing is selected that will automatically mean the maximum value. If the user does select one of more values then the maximum value of that selection is used. Your PERIOD field seems to contain numeric values so the max function should work fine. If for example your chart contains an expression sum(Inventory) you would have to change it to sum({<PERIOD={$(=max(PERIOD))}>}Inventory). You'd have to make similar changes to all the expressions in all the charts.


talk is cheap, supply exceeds demand
MVP
MVP

Re: How to select the maximum value in an expression in a filed in qlik sense

David Behar wrote:

Hi Stefan

Thanks for your replay but my period variable are NUMERIC

Ok, but I would assume that my expression should have work also with numeric values.

Anyway, since your issue seems to be resolved, please close this thread by flagging helpful and / or correct answers.

Qlik Community Tip: Marking Replies as Correct or Helpful

Not applicable

Re: How to select the maximum value in an expression in a filed in qlik sense

Thanks

It worked also