Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert number to time in format hh:mm:ss

Dear qlikview users,

I'm developing a dashboard where the gasconsumption over time is visible. One must be able to filter out the data by selected a time range.
This must be done for 3 expressions in one chart. So a user can select 3 different time ranges.  I'm using 3 sliders for selecting the timerange.

My expression is as follows:

Sum({<Category = {'GA1'}, Hour ={">=$(v_num_shift1_min) <=$(v_num_shift1_max)"}>}[Total value])

The field "Hour" stands for the time and has the format: hh:mm:ss

The variables v_num_shift1_min and v_num_shift1_max indicates the minimum and maximum values. My slider shows the whole hours: 1,2,3 etc.

A sample value of one of the variables: 0,08333. I want to convert this number value in the format hh:mm:ss, so that my expression can work.


1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

Sum({<Category = {'GA1'}, Hour ={">=$(=Time(v_num_shift1_min)) <=$(=Time(v_num_shift1_max))"}>}[Total value])

or with explicite format code:

Sum({<Category = {'GA1'}, Hour ={">=$(=Time(v_num_shift1_min,'hh:mm:ss')) <=$(=Time(v_num_shift1_max,'hh:mm:ss'))"}>}[Total value])

View solution in original post

2 Replies
swuehl
MVP
MVP

Try

Sum({<Category = {'GA1'}, Hour ={">=$(=Time(v_num_shift1_min)) <=$(=Time(v_num_shift1_max))"}>}[Total value])

or with explicite format code:

Sum({<Category = {'GA1'}, Hour ={">=$(=Time(v_num_shift1_min,'hh:mm:ss')) <=$(=Time(v_num_shift1_max,'hh:mm:ss'))"}>}[Total value])

Not applicable
Author

try this

Sum({<Category = {'GA1'}, Hour ={">=$(=Time(v_num_shift1_min,'hh:mm:ss')) <=$(=Time(v_num_shift1_max,'hh:mm:ss'))"}>}[Total value])

or try this

Sum({<Category = {'GA1'}, Hour ={">=$(=Date(v_num_shift1_min,'hh:mm:ss')) <=$(=Date(v_num_shift1_max,'hh:mm:ss'))"}>}[Total value])