6 Replies Latest reply: Jan 31, 2012 3:16 PM by Jack Mahoney RSS

    Filter between two time variables

      I'm sure this is simple, but I just can't get it to work.  I have an Input Box with two variables: StartTime and EndTime.  I have a button that on click should filter the data to only show the records between the two time variables that have been input into the box.  In the Actions of the button, I have 'Select in Field' - 'Field' is "ActTime" and 'Search String' is "='>=' & StartTime & '<=' EndTime".   When I click the button, nothing happens.  What can I do differently?

        • Re: Filter between two time variables
          Miguel Angel Baeyens de Arce

          Hi,

           

          Probably checking that the format in fields and the format returned by the variables is the same would be enough. When using slider/calendar objects or input boxes, values are stored as numeric, while the match in the field is done using the literal, I'd bet on something like this in the search string of the action

           

          ='>=' & Time(StartTime) & '<=' Time(EndTime)
          

           

          Time() only returns the time part of a complete timestamp, so if the input data of Start Time is "31/01/2012 16:54:32" Time() will return "16:54:32". In QlikView, 24 hours (one day) has a numeric value of 1, and 12 hours have a numeric value of 0.5 and so. Variables might be storing something like "0.59976".

           

          Hope that helps.

           

          Miguel