Qlik Community

Qlik Sense Advanced Authoring

Discussion board where members can learn more about Qlik Sense Advanced Authoring.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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?

 

9 Replies
Highlighted

Re: Returning last 7 days of data

May be something like this

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

Re: Returning last 7 days of data

Its returning a zero value
Highlighted

Re: Returning last 7 days of data

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

Re: Returning last 7 days of data

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

Highlighted

Re: Returning last 7 days of data

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

Re: Returning last 7 days of data

max date

Highlighted

Re: Returning last 7 days of data

Then try this

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

Re: Returning last 7 days of data

Still returning a zero value

Highlighted

Re: Returning last 7 days of data

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