Filter a chart to get data corresponding to latest dates (from a date field)

Hello Team,

If I have a dataset with a date field (Sale_Date), and I want to return rows with the 5 latest “Sale_Date” (descending sort on the date field), How can I do that?

Considering the below example dataset,

|Client|Product|Price|Sale_Date|

|XYZ|tv|1000|01-08-2023|
|ABC|fridge|1000|01-08-2023|
|DEF|ac|1000|03-08-2023|
|XYZ|tv|1000|04-08-2023|
|ABC|tv|1000|05-08-2023|
|ABC|ac|1000|07-08-2023|
|DEF|ac|1000|07-08-2023|
|XYZ|tv|1000|07-08-2023|
|XYZ|phone|1000|09-08-2023|
|ABC|phone|1000|10-08-2023|
|GHI|tv|1000|13-08-2023|
|KLM|phone|1000|13-08-2023|
|ABC|ac|1000|13-08-2023|
|KLM|tv|1000|14-08-2023|
|XYZ|ac|1000|14-08-2023|
|LMN|tv|1000|16-08-2023|

The output of the filter in the chart should be:

|XYZ|phone|1000|09-08-2023|
|ABC|phone|1000|10-08-2023|
|GHI|tv|1000|13-08-2023|
|KLM|phone|1000|13-08-2023|
|ABC|ac|1000|13-08-2023|
|KLM|tv|1000|14-08-2023|
|XYZ|ac|1000|14-08-2023|
|LMN|tv|1000|16-08-2023|

Or

|KLM|phone|1000|13-08-2023|
|ABC|ac|1000|13-08-2023|
|KLM|tv|1000|14-08-2023|
|XYZ|ac|1000|14-08-2023|
|LMN|tv|1000|16-08-2023|

When I use Top/bottom filter, when I choose the date field, the filter is on either count or min/max.

Regards,
Likhit Rai

I created a calculated field with (rank) to rank the date fields in Descending order.
However, I am unable to filter using the calculated field.

image

Also, is there a way to do this without creating a calculated field?

Thanks,
Likhit

hi @likhitrai

I think you can use top/bottom filter with max aggregation for Sale_Date, specifying Top 5.

kind regards,
Wakana

Thanks @Wakana, Is there a way to achieve this without creating a rank field?

hi @likhitrai

I meant not to create rank calc field. you can just simply use Top/Bottom filter.

kind regards,
Wakana