Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

creating filters for last24 hours, last 7 days etc.,

We have our data in hour granularity. schema is like this

power_consumed:

LOAD

area,

power,

time;

SELECT

area,

power,

[time]

FROM utilisation;


In our charts x- axis is time, y axis is say power and area. I want to create a chart where I can have a drop down or buttons like last24 hours, last 7 days etc., and on selection I should be seeing only 24 hours or 7 days or 30 days of data.

3 Replies
Highlighted
Master
Master

We are using an extension called Field UI that you can get from Qlik Branch.

You can define the expression for the button something like this.  This particular button is for the past 90 days.

=if(CalendarDate > (today()-90), '90 Days')

You could do calculations like this on your fields for the time periods that you want to see when the user clicks on the button.

Highlighted

IS there any challenge when you face any issue?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor
Contributor

Hi Anil, the problem I am facing is that how to display the filter to show last24 hours, last 7 days etc


I created variables like this

LET v24HoursAgo = Date(now()-1, 'MM/DD/YYYY hh:mm:ss');

LET v7DaysAgo = Date(now()-7, 'MM/DD/YYYY hh:mm:ss');

and created filter panels with fields like =time > v24HoursAgo, but filter panel comes with a dropdown with values as -1 and 0 which we are looking to avoid here