Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
matthewp
Creator III
Creator 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
Creator III
Creator III
Author

This worked

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

View solution in original post

5 Replies
PrashantSangle

Hi,

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

Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunny_talwar

See if this works:

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

kavita25
Partner - Specialist
Partner - Specialist

Try this:

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

kavita25
Partner - Specialist
Partner - Specialist

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

matthewp
Creator III
Creator III
Author

This worked

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