Qlik Community

Qlik Sense Advanced Authoring

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

Highlighted
Giselle100
New Contributor II

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

Re: Returning last 7 days of data

May be something like this

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

Re: Returning last 7 days of data

Its returning a zero value

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?
Giselle100
New Contributor II

Re: Returning last 7 days of data

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

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?
Giselle100
New Contributor II

Re: Returning last 7 days of data

max date

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])
Giselle100
New Contributor II

Re: Returning last 7 days of data

Still returning a zero value

Re: Returning last 7 days of data

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