<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Avg(TimeValues) with not subsequent days in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687800#M677399</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;=Time(Avg([End Work Shift]),'hh:mm:ss')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Jun 2014 18:43:41 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2014-06-16T18:43:41Z</dc:date>
    <item>
      <title>Avg(TimeValues) with not subsequent days</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687799#M677398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author"&gt;I have an unwanted result with Avg() function using time values (End of Work Shift), it works fine when selecting one or multiple values but &lt;SPAN class="j-post-author"&gt;only if they are of subsequent days I mean selecting 2nd to 7th Jun days the function sends the right Average (Scenario 1) but if selecting values like&lt;EM&gt; 2nd to 7th and a&lt;/EM&gt;dding the 9th day excluding 8th) (Scenario 2)&amp;nbsp; the resulting average is not the expected. I tried to use the time values as time and num format but the results are the same. I can't find a way to make this work, im even using a formula but works the same way:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Avg&lt;/SPAN&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;HORA_SALIDA_HHC&lt;/SPAN&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;or&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author" style="color: black; font-size: 9.0pt; font-family: 'Arial','sans-serif';"&gt;&lt;STRONG&gt;=&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;HORA_SALIDA_HHC&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;) / &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;DISTINCT&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;FECHA_HH&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Results desire and undesired are in the excel attached.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author" style="color: black; font-size: 9.0pt; font-family: 'Arial','sans-serif';"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="ES-MX"&gt;can someone please give me a hand to understand the unwanted result?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="ES-MX"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="ES-MX"&gt;Attached a qvw sample, please select 02/06/14 to 09/06/14 from &lt;STRONG&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN lang="ES-MX" style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;SPAN class="j-post-author" style="color: black; font-size: 9.0pt; font-family: 'Arial','sans-serif';"&gt;&lt;STRONG style="color: maroon; font-size: 9.0pt; font-family: 'Arial','sans-serif';"&gt;FECHA_HH &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN lang="ES-MX"&gt;&lt;SPAN lang="ES-MX"&gt;l&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="ES-MX"&gt;&lt;SPAN lang="ES-MX"&gt;is&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="ES-MX"&gt;&lt;SPAN lang="ES-MX"&gt;tbox&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="ES-MX"&gt; to match with the excel sample.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 18:07:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687799#M677398</guid>
      <dc:creator>Emmanuelle__Bustos</dc:creator>
      <dc:date>2014-06-16T18:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Avg(TimeValues) with not subsequent days</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687800#M677399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;=Time(Avg([End Work Shift]),'hh:mm:ss')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 18:43:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687800#M677399</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-06-16T18:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Avg(TimeValues) with not subsequent days</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687801#M677400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manish &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response, but this formula only gives time format but the result is the same. The problem is not the format but the final result when select dates with not subsequent days.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 18:52:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687801#M677400</guid>
      <dc:creator>Emmanuelle__Bustos</dc:creator>
      <dc:date>2014-06-16T18:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Avg(TimeValues) with not subsequent days</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687802#M677401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Emmanulle,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you upload an example of the issue. I cannot recreate the issue with the Excel data. Interesting, QlikView calculates an average of 9:01:&lt;STRONG&gt;41&lt;/STRONG&gt; for the second scenario...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 18:55:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687802#M677401</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-06-16T18:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Avg(TimeValues) with not subsequent days</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687803#M677402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is already attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 19:00:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687803#M677402</guid>
      <dc:creator>Emmanuelle__Bustos</dc:creator>
      <dc:date>2014-06-16T19:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Avg(TimeValues) with not subsequent days</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687804#M677403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The solution is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=time(avg(frac(HORA_SALIDA_TIME)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the field contains a whole timestamp value..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 19:37:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687804#M677403</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-06-16T19:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Avg(TimeValues) with not subsequent days</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687805#M677404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;..or the other field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=time(avg(frac(HORA_SALIDA_HHC)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 19:43:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687805#M677404</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-06-16T19:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Avg(TimeValues) with not subsequent days</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687806#M677405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Ralf Becher&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It Works!!&amp;nbsp; But stil don't get how the Frac() function does the trick since I know it returns the fraction part, so this means that the integer part is the other timestamp info?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is the case my doubt is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the script I load the field HORA_SALIDA as HORA_SALIDA (it is loaded as numeric format like 41792.377....) &lt;/P&gt;&lt;P&gt;so I load&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Time(HORA_SALIDA) as HORA_SALIDA_TIME (it is loaded as 9:04:12 AM ....)&lt;/P&gt;&lt;P&gt;and load&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l TimeStamp(HORA_SALIDA) as HORA_SALIDA_HHC (it is loaded as 06/06/2014 9:04:12 AM...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;since in the second load I used the Time() function for loading then I wasn't supposed to need the Frac() function in the Expression was I? If so is because even when using the Time() function the fields still load the integer part corresponding to the Full TimeStamp??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For now this is Solved thank you so much for your help and if you are able to clarify this last point I will be twice thankful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 23:01:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687806#M677405</guid>
      <dc:creator>Emmanuelle__Bustos</dc:creator>
      <dc:date>2014-06-16T23:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Avg(TimeValues) with not subsequent days</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687807#M677406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, the fraction is the time part. One day = 1. You could also solve the problem during load using the Time#() function - Time() does only the formatting of the text representaion, doesn't touch the value; or Frac() itself. It's a bit confusing here that you see the text representaion of time only here, but the value is a full timestamp. It has cost me some time to find it out although it is a very simple problem..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 23:09:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687807#M677406</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-06-16T23:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Avg(TimeValues) with not subsequent days</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687808#M677407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I already get it Ralf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Time#() function was the necessary since the beginning. Once again thank you for your help!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 23:20:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-TimeValues-with-not-subsequent-days/m-p/687808#M677407</guid>
      <dc:creator>Emmanuelle__Bustos</dc:creator>
      <dc:date>2014-06-16T23:20:36Z</dc:date>
    </item>
  </channel>
</rss>

