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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
AndreasGu
Contributor II
Contributor II

Date filter in Straight table

I have created a table in Qlik Sense Cloud that would show recent sales data.

Ideally I would like to show the last three days of Order data (Order date / sv. Orderdatum). However I'm unsure of how to prompt the filter tab to get the desire result. I have been able to just get last days of data by calling condition as per attached. 
Basically:

Filter 
Condition -> Compare
Orderdatum >= 
Calulated value
max Orderdatum

However, I would like to make something like "Yesterday()-1" or similiar within the Filter window. How can I achieve this. See sample picture.

By dimension in this case would be Orderdatum which is a date value in format yyyy-mm-dd

 

 

Labels (4)
1 Solution

Accepted Solutions
AndreasGu
Contributor II
Contributor II
Author

I was able to sort it using creating a custom dimension as per below.

=If(
	Orderdatum >= Date(today()-2)
	and Orderdatum <= Date(Today()-1),
    Orderdatum
)

I then excluded "Include null values"

So basically add the Orderdatum is the date is yesterday or the day before yesterday and then exclude all zero values.

View solution in original post

3 Replies
marcus_sommer

I would create such kind of information within the calendar within n flag-fields, for example:

pick(match(Date - today(), 0, -1, ...), 'Today', 'Yesterday', ...)

respectively just using the numeric offset-information and/or applying dual() to get numeric and string data. And by using The As-Of Table - Qlik Community - 1466130 are also n overlapping period-information within a single field possible.

Daniel_Castella
Support
Support

Hi @AndreasGu 

 

I think it will be better for you to use Set Analysis instead of the chart filter. In a straight table, if you are calculating for example Sum(Order) and you want to limit this calculation only for the three last days in Orderdatum you can rewrite it like:

 

Sum({<Orderdatum={"<=$(=Max(Orderdatum)) >=$(=Max(Orderdatum,3))"}>} Order)

 

In this way you will only calculate between the maximum value in Orderdatum and the third maximum value in that field (hence, the 3 last days).

 

Let me know if this works for you.

 

Kind Regards

Daniel

AndreasGu
Contributor II
Contributor II
Author

I was able to sort it using creating a custom dimension as per below.

=If(
	Orderdatum >= Date(today()-2)
	and Orderdatum <= Date(Today()-1),
    Orderdatum
)

I then excluded "Include null values"

So basically add the Orderdatum is the date is yesterday or the day before yesterday and then exclude all zero values.