Qlikview Count of ids in last 12 months in text object (box)

531 Views Asked by At

I have two fields in my table Date & ID, i want to put in a text box the count of all the ids for the last 12 months.

This returns nothing:

=Num(count({$<DATE={'>=$(=AddMonths(Today(),-12))'}>}[ID]),'#,##0')

This returns the correct count:

=count(ID)

This returns the total for the year (2015):

SUM(IF( year(DATE) = year(today()),1,0))
1

There are 1 best solutions below

0
On BEST ANSWER

Using the MonthName function on the date to parse it exactly as the AddMonths function does

=SUM(IF( (date(Monthname(DATE),'MMM-YY')) >=(AddMonths(Today(),-12)),1,0))