Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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)
You can try like these
Maybe it should work
sum({<PERIOD = {"$(=max(PERIOD))"}>}value)
Thanks,
Bob
Hi Stefan
Thanks for your replay but my period variable are NUMERIC
Worked, thanks a lot
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.
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.
Thanks
It worked also