# Qlik Sense App Development

New Contributor II

## Custom date range filters

I have a table that I would like to assign three custom filters to: 30 day, 60 day, and 90 day. Is this possible to do purely through a custom field in the filter pane?

1 Solution

Accepted Solutions

## Re: Custom date range filters

Hi,

In that case you will have to create in script like below.

If((Today()-Date) <=30,'30 Days',

If((Today()-Date) >30 and (Today()-Date) <=60,'60 Days' ,

If((Today()-Date) >60 and (Today()-Date) <=90,'90 Days' ,'More than 90 days'))) as Bucket

From xyz;

Use this bucket field as filter or dimension.

Regards,

Kaushik Solanki

4 Replies

## Re: Custom date range filters

Hi,

Yes it is possible for example.

Sum({<Date = {">=\$(=Max(Date)-30)"}>}Sales)

It will give the sales for last 30 days.

Regards,

Kaushik Solanki

New Contributor II

## Re: Custom date range filters

Thank you for your reply. Your code would give me the sum of sales for the last 30 days. What I am looking for is a filter that would adjust the whole table and have 30 days, 60 days, and 90 days as options.

## Re: Custom date range filters

Hi,

In that case you will have to create in script like below.

If((Today()-Date) <=30,'30 Days',

If((Today()-Date) >30 and (Today()-Date) <=60,'60 Days' ,

If((Today()-Date) >60 and (Today()-Date) <=90,'90 Days' ,'More than 90 days'))) as Bucket

From xyz;

Use this bucket field as filter or dimension.

Regards,

Kaushik Solanki

New Contributor II

## Re: Custom date range filters

Thank you very much. This accomplishes exactly what I was looking for.