<?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: Promedio acumulativo de tiempos y como convertir una fecha en SS a DD HH:MM:SS in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Promedio-acumulativo-de-tiempos-y-como-convertir-una-fecha-en-SS/m-p/2066381#M87481</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/70836"&gt;@hvantoni&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate"&gt;Date()&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;formats an expression as a date using the format set in the system variables in the load script, or the operating system, or a format string, if supplied.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="syntax_heading" data-mc-autonum="Syntax: "&gt;&lt;SPAN class="autonumber"&gt;&lt;SPAN&gt;Syntax:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate"&gt;&lt;SPAN class="script_token"&gt;Date(&lt;/SPAN&gt;number&lt;SPAN class="bnf_token"&gt;[, format]&lt;/SPAN&gt;&lt;SPAN class="statement"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate"&gt;&lt;SPAN class="statement"&gt;Example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;date(datefield,'DD/MM/YYYY')&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;date(date#(datefield,'current format'),'DD/MM/YYYY')&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Date#(Alt(Num(Date#(DATE, 'MM-DD-YYYY')), Num(Date#(DATE, 'MMM DD YYYY'))), 'DD/MM/YYYY') as DATE&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;It is an example, so you may modify or change accordingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, Padma&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2023 17:29:33 GMT</pubDate>
    <dc:creator>PadmaPriya</dc:creator>
    <dc:date>2023-05-01T17:29:33Z</dc:date>
    <item>
      <title>Promedio acumulativo de tiempos y como convertir una fecha en SS a DD HH:MM:SS</title>
      <link>https://community.qlik.com/t5/App-Development/Promedio-acumulativo-de-tiempos-y-como-convertir-una-fecha-en-SS/m-p/2066307#M87478</link>
      <description>&lt;P&gt;Genero expedientes digitales, cada expediente tiene varias fases, cada fase tiene una fecha/hora de inicio y una fecha/hora de fin de fase. Necesito calcular 1.- la duración total de un expediente en DD hh:mm:ss, 2,- necesito hallar el promedio de tiempo de tos los expedientes. 3.- Hallar el promedio por fases de expediente del mismo tipo.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hvantoni_0-1682941334747.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/106170i6E2F2D2B9CC77DAA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hvantoni_0-1682941334747.png" alt="hvantoni_0-1682941334747.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;he utilizado las siguientes medidas:&lt;/P&gt;
&lt;P&gt;interval(FECHA_FIN_ACTIV-FECHA_INI_ACTIV, 'ss')&amp;nbsp; como dif_en_seg&lt;/P&gt;
&lt;P&gt;Div(NUM#(dif_en_seg),86400) como dif_en_dias&lt;/P&gt;
&lt;P&gt;fmod(NUM#(dif_en_seg),86400) como dif_dias_resto&lt;/P&gt;
&lt;P&gt;He intentado pero no me funciona&lt;/P&gt;
&lt;P&gt;Floor(dif_en_seg / 86400) &amp;amp; 'd ' &amp;amp; Time(Mod(dif_en_seg, 86400), 'hh:mm:ss')&lt;/P&gt;
&lt;P&gt;tampoco se como acumular el total del tiempo de todos los expedientes para luego hallar su promedio&lt;/P&gt;
&lt;P&gt;algo&amp;nbsp; parecido a esto&amp;nbsp;Avg(Sum(Interval(FECHA_INI_ACTIV, FECHA_FIN_ACTIV))) over ()&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 11:51:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Promedio-acumulativo-de-tiempos-y-como-convertir-una-fecha-en-SS/m-p/2066307#M87478</guid>
      <dc:creator>hvantoni</dc:creator>
      <dc:date>2023-05-01T11:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Promedio acumulativo de tiempos y como convertir una fecha en SS a DD HH:MM:SS</title>
      <link>https://community.qlik.com/t5/App-Development/Promedio-acumulativo-de-tiempos-y-como-convertir-una-fecha-en-SS/m-p/2066381#M87481</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/70836"&gt;@hvantoni&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate"&gt;Date()&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;formats an expression as a date using the format set in the system variables in the load script, or the operating system, or a format string, if supplied.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="syntax_heading" data-mc-autonum="Syntax: "&gt;&lt;SPAN class="autonumber"&gt;&lt;SPAN&gt;Syntax:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate"&gt;&lt;SPAN class="script_token"&gt;Date(&lt;/SPAN&gt;number&lt;SPAN class="bnf_token"&gt;[, format]&lt;/SPAN&gt;&lt;SPAN class="statement"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Primary.NotToTranslate"&gt;&lt;SPAN class="statement"&gt;Example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;date(datefield,'DD/MM/YYYY')&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;date(date#(datefield,'current format'),'DD/MM/YYYY')&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Date#(Alt(Num(Date#(DATE, 'MM-DD-YYYY')), Num(Date#(DATE, 'MMM DD YYYY'))), 'DD/MM/YYYY') as DATE&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;It is an example, so you may modify or change accordingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, Padma&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 17:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Promedio-acumulativo-de-tiempos-y-como-convertir-una-fecha-en-SS/m-p/2066381#M87481</guid>
      <dc:creator>PadmaPriya</dc:creator>
      <dc:date>2023-05-01T17:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Promedio acumulativo de tiempos y como convertir una fecha en SS a DD HH:MM:SS</title>
      <link>https://community.qlik.com/t5/App-Development/Promedio-acumulativo-de-tiempos-y-como-convertir-una-fecha-en-SS/m-p/2066397#M87482</link>
      <description>&lt;P&gt;Hola, a la expresión le faltaría dividir el tiempo del mod para pasarlo a segundos:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Floor(dif_en_seg / 86400) &amp;amp; 'd ' &amp;amp; Time(Mod(dif_en_seg, 86400) / 86400, 'hh:mm:ss')&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Y para el avg se podría usar Aggr:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Avg(Aggr(Sum(Interval(FECHA_INI_ACTIV, FECHA_FIN_ACTIV)),NUMERO_EXPEDIENTE)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Otra opción sería añadir una tabla en el script relacionada con los expedientes que ya tenga calculado el tiempo en segundos, con lo que un simple avg() de este campo podría servir.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 18:07:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Promedio-acumulativo-de-tiempos-y-como-convertir-una-fecha-en-SS/m-p/2066397#M87482</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2023-05-01T18:07:58Z</dc:date>
    </item>
  </channel>
</rss>

