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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
jakobjensen
Contributor II
Contributor II

Count distinct dates greater than a given date

Say I want to count the number of distinct dates that have been within the last 365 days. I wrote the following meassure

count({<[orderdate.autoCalendar.Date]={">Date([orderdate.autoCalendar.Date]-365)"}>},  distinct [orderdate.autoCalendar.Date])

but that just returns "0"

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Try like:

count({<[orderdate.autoCalendar.Date]={">$(=Date([orderdate.autoCalendar.Date]-365))"}>}  distinct [orderdate.autoCalendar.Date])

View solution in original post

1 Reply
tresB
Champion III
Champion III

Try like:

count({<[orderdate.autoCalendar.Date]={">$(=Date([orderdate.autoCalendar.Date]-365))"}>}  distinct [orderdate.autoCalendar.Date])