Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I need help with the creation of a date filter.
I want to create a filter with 3 options: all days until 30 days from today, all days until 60 days from today, and all days until 90 days from today.
I have a canonical table with the date column. To create the filter, I added the filter visualization and the code:
If ( DaysDifference<= 30, '30days',
If ( DaysDifference<= 60, '60days',
If ( DaysDifference<= 90, '90days' ) ) )
The problem is that when I select the 60 days filter, I get the information from 30-60 days and not all the dates before 60 days.
Do you know how to solve this?
Thank you in advance!
with an above if () block one date can only be under one classfication
you need to create multiple fields , refer below example
Calendar:
Date,Month,Year,..........
,If ( DaysDifference<= 30, 1) as 30days
,If ( DaysDifference<= 60, 1) as 60days
,If ( DaysDifference<= 90, 1) as 90days
CrossTable(Period,PeriodVal,1)
Load Date,30days,60days,90days
Resident Calendar;
Then use the Period field as filter
refer below for more
Period Presets: Compare Periods on the fly - Qlik Community - 1486371
hi may be this
If((DaysDifference<=30,'30 Days',
If((DaysDifference >30 and DaysDifference <=60,'60 Days' ,
If(DaysDifference >60 and DaysDifference <=90,'90 Days' ,'More than 90 days')))
with an above if () block one date can only be under one classfication
you need to create multiple fields , refer below example
Calendar:
Date,Month,Year,..........
,If ( DaysDifference<= 30, 1) as 30days
,If ( DaysDifference<= 60, 1) as 60days
,If ( DaysDifference<= 90, 1) as 90days
CrossTable(Period,PeriodVal,1)
Load Date,30days,60days,90days
Resident Calendar;
Then use the Period field as filter
refer below for more
Period Presets: Compare Periods on the fly - Qlik Community - 1486371
Thank you Vinieme,
That was exatly what I was looking for. I had a bridge table in my example, so what I did was to add those three columns in my table and do a crosstable in that one so that I could have all the filters.