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

How do I extract start/end dates in a calendar slider for use in a formula?

I have a table of data that represents a task that runs every few days for a few hours. I have data for 1 year - the task is sporadic. I am using a slider object to select subsets of data for reporting, etc., so that slider is set to 'field' mode as I want it to act as a selection on a field in my table.

In addition, I would like to show the percentage of time in the period selected by the slider that the task is running.

For example, if I have selected one week in which my data is:

Tuesday: 2 hrs, Wed: 5 hrs, Friday: 6 hrs.

I would like the percentage of time to show (2 + 5 + 6) / (7 * 24).

The issue I'm having is that I'm not able to use the slider as both a field and a variable. When I use it as a field, I'm not able to use the start and end dates in the formula for the "percentage running time" chart. When I use it as a multi-variable, the selection doesn't limit the number of data points to just that week.

The closest thing I've been able to do is to use the min/max on the data itself, but the issue is that the denominator in my '% running time' chart is then only the time between Tuesday and Friday.

Please let me know if there's any way I can use the start/end on a field slider in a formula..

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hello,

I think it's possible what you are looking for. Take a look at this file where sliders store some temporal dimensions that are used in charts.

Note that I'm using calendar for dates because there are lots of them, and sliders for years because there are a few. The object is the same, it only varies the configuration (Slider/Calendar).

Hope that helps.

View solution in original post

2 Replies
Miguel_Angel_Baeyens

Hello,

I think it's possible what you are looking for. Take a look at this file where sliders store some temporal dimensions that are used in charts.

Note that I'm using calendar for dates because there are lots of them, and sliders for years because there are a few. The object is the same, it only varies the configuration (Slider/Calendar).

Hope that helps.

Not applicable
Author

Thanks Miguel.

It wasn't exactly what I needed, but it did help me get to a solution! 🙂 I ended up just using a master calendar as you had in your example and using the slider as a selection on the master calendar. I then had to use some logic in my charts (much as you did for the set analysis) in order to do the calculations right.

Appreciate the quick response!