Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the expression - Count({<ADMIT_MNTH = {"$(=Max(ADMIT_MNTH))"}>}[Patient]) which gives me the max month but i know need the same expression but the previous month so MINUS 1
Thanks
Kev
use addmonths function with -1
Count({<ADMIT_MNTH = {"$(=AddMonths(Max(ADMIT_MNTH),-1))"}>}[Patient])
check output of this expression in a text object and check
AddMonths(Max(ADMIT_MNTH),-1)
try below
assuming ADMIT_MNTH format is MMM YYYY. In below set you can try giving actual format
Count({<ADMIT_MNTH = {"$(=date(addmonths(Max(ADMIT_MNTH),-1),'MMM YYYY'))"}>}[Patient])
@kev6brown wrap it with date and try
Hi,
I know this is an old thread (well, this thread is the first on Google 😃), but I had a kinda-similar problem, when I had to lookup the value before highest value.
If you use
max([Field])
you obviously get highest value of [Field]. With this value, you can do simple maths, like max()-1 or "add" -1 day, month ... to a date. But if the value before the highest is not guessable, you can use the second parameter of max() function :
max([Field], 2)
This will return the value before the highest, in both Qlikview and Qliksense. A similar parameter also exists for min().
In that case, this should do the trick :
Count({<ADMIT_MNTH = {"$(=Max(ADMIT_MNTH, 2))"}>}[Patient])