Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
matthewp
Contributor III

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

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 Solution

Accepted Solutions
matthewp
Contributor III

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

This worked

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

View solution in original post

5 Replies

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

Hi,

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

Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.

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

See if this works:

=Count({<DATE = {"$(='>=' & Date(AddMonths(Max(DATE), -12), 'YourDateFieldFormat') & '<=' & Date(Max(DATE), 'YourDateFieldFormat'))"}>} ID)

Partner
Partner

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

Try this:

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

Partner
Partner

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

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

matthewp
Contributor III

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

This worked

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

View solution in original post