Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filtering in Count

Hi folks,
someone can help me on this sentence:
=count({$<AuditMonthYear={">=$(=Date(AddMonths(Today(),-1)), 'MMM-YYYY')))"}>} [Answer Mice])
I want to know what is wrong with that. I just want to know how many incidents we faced last month. I'm getting 0.
Thanks!
PS: The format date for both fields is MMM-YYYY so we got from both Jan-2012
5 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

i think the problem your facing is that you try >=jan-2012 and it is not numeric

from my expirence the bets way is to have monthyear field who holds the month start date for every date in regular date format i.e 01/01/2012 that will work surley

llauses243
Creator III
Creator III

Hi adumd,

It this my offer, pls to see image attached

Good luck, Luis

SunilChauhan
Champion II
Champion II

try this

count({<AuditMonthYear={">=$(=Date(addmonths(today(),-1),'MMM-YYYY'))"}>} [Answer Mice])

AuditMonthYear should be in MMM-YYYY format.

hope this helps

Sunil Chauhan
Not applicable
Author

try to implement this:

count({$<AuditMonthYear>={"$(=(Date(AddMonths(Today(),-1)), 'MMM-YYYY'))"}>}[Answer Mice]).

Not applicable
Author

Thanks Sunil,

considering differents answers received, your is most close to the final result. Nevertheless the result is not quite correct. I'm getting 57 instead 51 (which is the correct number). Maybe you can explain to me how the ={">=$(=Date(addmonths(today(),-1),'MMM-YYYY'))"}>} works. I think I got some idea, but just want to be sure.

Thanks in advance!