<?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 Duration format conversion depending on value in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Duration-format-conversion-depending-on-value/m-p/1625589#M46599</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to calculate the average duration of several incidents using aggr function. My expression works, showing days or HH:MM:SS depending on format selection (Duration or automatic). But what I want is automatic switch depeding on duration value. If duration is above 24h, I wish to show" DD days, hh hours, mm minutes", but if duration is less than a day, the format should be "hh hours: mm minutes".&amp;nbsp;&lt;/P&gt;&lt;P&gt;The expression I am ussing is&amp;nbsp;&lt;/P&gt;&lt;P&gt;avg(aggr(interval(date(Max(AuditDate))-date(Min(AuditDate)),'d hh:mm'),IncidentID))&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Many thnaks in advance,&lt;/P&gt;&lt;P&gt;César&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 20:03:10 GMT</pubDate>
    <dc:creator>ccastrillo</dc:creator>
    <dc:date>2024-11-16T20:03:10Z</dc:date>
    <item>
      <title>Duration format conversion depending on value</title>
      <link>https://community.qlik.com/t5/App-Development/Duration-format-conversion-depending-on-value/m-p/1625589#M46599</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to calculate the average duration of several incidents using aggr function. My expression works, showing days or HH:MM:SS depending on format selection (Duration or automatic). But what I want is automatic switch depeding on duration value. If duration is above 24h, I wish to show" DD days, hh hours, mm minutes", but if duration is less than a day, the format should be "hh hours: mm minutes".&amp;nbsp;&lt;/P&gt;&lt;P&gt;The expression I am ussing is&amp;nbsp;&lt;/P&gt;&lt;P&gt;avg(aggr(interval(date(Max(AuditDate))-date(Min(AuditDate)),'d hh:mm'),IncidentID))&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Many thnaks in advance,&lt;/P&gt;&lt;P&gt;César&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:03:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Duration-format-conversion-depending-on-value/m-p/1625589#M46599</guid>
      <dc:creator>ccastrillo</dc:creator>
      <dc:date>2024-11-16T20:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Duration format conversion depending on value</title>
      <link>https://community.qlik.com/t5/App-Development/Duration-format-conversion-depending-on-value/m-p/1630493#M46942</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;avg(aggr(interval(date(Max(AuditDate))-date(Min(AuditDate)),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If(date(Max(AuditDate))-date(Min(AuditDate))&amp;gt;=1,'d hh:mm:ss','hh:mm:ss')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;),IncidentID))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 13:25:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Duration-format-conversion-depending-on-value/m-p/1630493#M46942</guid>
      <dc:creator>StarinieriG</dc:creator>
      <dc:date>2019-10-02T13:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Duration format conversion depending on value</title>
      <link>https://community.qlik.com/t5/App-Development/Duration-format-conversion-depending-on-value/m-p/1635247#M47325</link>
      <description>&lt;P&gt;Thanks StarinieriG, it works!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 07:59:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Duration-format-conversion-depending-on-value/m-p/1635247#M47325</guid>
      <dc:creator>ccastrillo</dc:creator>
      <dc:date>2019-10-15T07:59:53Z</dc:date>
    </item>
  </channel>
</rss>

