title: Elapsed time calculations for data within selected date range
body: <p>I have data setup as follows:</p>
  
  <pre><code>Start Date | End Date 
     A       |       B       
  </code></pre>
  
  <p>I want the user to be able to select a date range from a drop down on a sheet, and I need to calculate if A and B (dates from the data) are within the selected date range. If they are, I need to calculate B-A (time elapsed), if not, I need to calculate only the time that elapsed in the selected date range.</p>
  
  <p>Example:</p>
  
  <p>Dates in data: 1/10/2013 to 1/15/2013</p>
  
  <p>User-selected date range: 1/1/2013 to 1/13/2013</p>
  
  <p>I want to calculate the elapsed time as 1/10/2013 to 1/13/2013 (3 days)</p>
  
  <p>What is the best way to do this? I'm new with qlikview, but have php programming experience. Usually I would set the user-selected date range as a variable, and then write a function to calculate the elapsed time based on the data. How is this done in qlikview?</p>
  
  <p>Any help is greatly appreciated.</p>
  
  <p>Best,</p>
  
  <p>Daniel</p>