Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

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

Load *,Date,

         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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

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.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

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

Load *,Date,

         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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

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