Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to find count of events last year based on today's date

Hi Experts,

The title pretty much says it all.  I'm trying to write an expression that will return the count of events where [YearOccurred] = last year, but I need it to be based on the current date.  So right now it would return records where [YearOccurred] = 2014, but on Jan 1 it would return records for 2015.

This isn't working.  Does anyone know if I'm close? 

=Count( {1<Department={"Repair"},  Year = {"=YearAdd(Year(Today()),-1)"}>} DISTINCT VisitID) 

Thanks in advance!

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Try with:

=Count({1<Department={"Repair"},Year={"$(=Year(Today())-1)"}>} DISTINCT VisitID)

View solution in original post

4 Replies
maxgro
MVP
MVP

it could be ($ or 1 it depends)

count({$ <Department={Repair},Year={$(=Year(Today())-1)}>} distinct VisitID)

settu_periasamy
Master III
Master III

Yearadd?

I think it is addyears

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Try with:

=Count({1<Department={"Repair"},Year={"$(=Year(Today())-1)"}>} DISTINCT VisitID)

Not applicable
Author

This worked perfectly!  Thank you to all who responded so quickly today, and especially Peter for a great answer.  Happy Holidays!