Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Giselle100
Contributor III
Contributor III

Returning last 7 days of data

Hi there

I have the below expression

Count({<[Status]={8} >}distinct [Order No] )

How do I amend it to only return the data for the last 7 days?

 

Labels (3)
9 Replies
sunny_talwar

May be something like this

Count({<[Status] = {8}, DateField = {"$(='>=' & Date(Today() - 7, 'DateFieldFormatHere'))"}>} DISTINCT [Order No])
Giselle100
Contributor III
Contributor III
Author

Its returning a zero value
sunny_talwar

What was the exact expression you used? Did you replace DateFieldFormatHere with the format of your date field?
Giselle100
Contributor III
Contributor III
Author

Count({<[Status] = {8}, [Outscan Date] = {"$(='>=' & Date(Today() - 7, 'YYYY/MM/DD'))"}>} DISTINCT [Order No])

sunny_talwar

The expression looks good... are you looking for last 7 days from today or last 7 days from the max date in the database?
Giselle100
Contributor III
Contributor III
Author

max date

sunny_talwar

Then try this

Count({<[Status] = {8}, [Outscan Date] = {"$(='>=' & Date(Max([Outscan Date]) - 7, 'YYYY/MM/DD'))"}>} DISTINCT [Order No])
Giselle100
Contributor III
Contributor III
Author

Still returning a zero value

sunny_talwar

Would you be able to share a sample to check this out?