Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

List Box for last 7, 14, 30 days?

Here is what I have written for the listbox expression:

=Aggr(

if(Date(Day)>Date(mDate-7), '7',

if(Date(Day)>Date(mDate-14),'14'))

,Day)

mdate is the maximum date, saved as a variable during the load script.

The resulting listbox has '7' and '14' as options.

'7' works as intended.

However, selecting '14' only selects 7 days, between 14 and 7 days old.

How do I fix this so '14' selects all 14 days?

2 Replies
marcus_sommer

Easier might be to solve this within the gui-expressions, like:

FilterDate: // for your listbox

Load * Inline [

Days

7

14

30

];

and then as expressions something like this:

sum({< Date = {">=date(Date - getfieldselections(FilterDate), 'YourFormat')"} >} value)

It might need some adjustments but the main-logic will work.

- Marcus

Not applicable
Author

Hi Sean,

How did you overcome this query, I am also facing the same problem if you have solution just share with me.

Thanks,

Ashok.