<?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: Interval function not working when formatting to hours in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185837#M383721</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to apply the formatting to the result of the numeric calculation, so in your case to the divison of the sum(Aggr()) and the Count() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried also this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interval() is a formatting function, as already mentioned by Gysbert. It only changes the text representation of a dual value, not the numeric value. Hence it doesn't make sense to use it in inner calculation steps. A following operation may remove the formatting again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, you can format the number 43210 as Date&lt;/P&gt;&lt;P&gt;=Date(43210)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you want to get the following date, &lt;/P&gt;&lt;P&gt;=Date(43210)+1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return the number 43210 again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence only use formatting functions like Date() or Interval() as most outer function / last step in your formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having said this, you are of course free to transform your intervals from the internal numeric representation using fraction of days to hours (multiplying by 24).&lt;/P&gt;&lt;P&gt;It may just make it harder to apply QV date and time functions to these values without doing a division again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Sep 2016 21:15:23 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-09-15T21:15:23Z</dc:date>
    <item>
      <title>Interval function not working when formatting to hours</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185829#M383713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have below expression that is assigned to a text object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp; Aggr(&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([Order Type Operaciones] ='A' and not(IsNull([Equipment Operaciones])) and Len(Trim([Equipment Operaciones]))&amp;gt;0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; Count({$&amp;lt;[Order Type Operaciones] = {'A'},[Actual start (date)]={'&amp;gt;=$(=MinDateBS)&amp;lt;=$(=MaxDateBS)'}&amp;gt;} [Operation/Activity]) &amp;gt; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval(MaxDateBS - Min({$&amp;lt;[Order Type Operaciones] = {'A'},[Actual start (date)]={'&amp;gt;=$(=MinDateBS)&amp;lt;=$(=MaxDateBS)'}&amp;gt;} [Actual start (date)]), 'h')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ) / Count({$&amp;lt;[Order Type Operaciones] = {'A'},[Actual start (date)]={'&amp;gt;=$(=MinDateBS)&amp;lt;=$(=MaxDateBS)'}&amp;gt;} [Operation/Activity])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (&lt;/P&gt;&lt;P&gt;&amp;nbsp; Count({$&amp;lt;[Order Type Operaciones] = {'A'},[Actual start (date)]={'&amp;gt;=$(=MinDateBS)&amp;lt;=$(=MaxDateBS)'}&amp;gt;} [Operation/Activity]) = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Interval(MaxDateBS - MinDateBS, 'h')&lt;/P&gt;&lt;P&gt;&amp;nbsp; , if (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count({$&amp;lt;[Order Type Operaciones] = {'A'},[Actual start (date)]={'&amp;gt;=$(=MinDateBS)&amp;lt;=$(=MaxDateBS)'}&amp;gt;}[Operation/Activity]) = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Interval(MaxDateBS - MinDateBS, 'h') / 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ))&lt;/P&gt;&lt;P&gt;&amp;nbsp; , [Equipment Operaciones]&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) &lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;/ Count({$&amp;lt;[Order Type Operaciones] = {'A'}, [Equipment Operaciones]={"=Len(Trim([Equipment Operaciones]))&amp;gt;0"}&amp;gt;} DISTINCT [Equipment Operaciones])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using Interval function within this expression, from example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Interval(MaxDateBS - MinDateBS, 'h')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Despite indicate the 'h' parameter, it is returning me the result in days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;However if the same expression (=&lt;SPAN style="font-size: 13.3333px;"&gt;Interval(MaxDateBS - MinDateBS, 'h')) &lt;/SPAN&gt;is assigned to another text object, it works well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;So why?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Is there any other approach to get the difference between two dates in hours?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;-------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;LAST EDIT - FINAL SOLUTION - 2016.09.16&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Note that MaxDateBS and MinDateBS are pure dates in the format 'DD/MM/YYYY'. I&lt;STRONG&gt; suppose difference between MaxDateBS and MinDateBS are always in days, am I right? Could you confirm me this, please?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Using Interval(Sum(Aggr(.......)), &lt;STRONG&gt;'h'&lt;/STRONG&gt;) is not working, that is, not returning value in hours, so I have used &lt;SPAN style="font-size: 13.3333px;"&gt;Interval(Sum(Aggr(.......)),&lt;STRONG&gt; 'd'&lt;/STRONG&gt;) * 24&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=&lt;STRONG&gt;Interval(&lt;/STRONG&gt;Sum(&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Aggr(&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([Order Type Operaciones] ='A' and not(IsNull([Equipment Operaciones])) and Len(Trim([Equipment Operaciones]))&amp;gt;0,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; if(&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Count({$&amp;lt;[Order Type Operaciones] = {'A'},[Actual start (date)]={'&amp;gt;=$(=MinDateBS)&amp;lt;=$(=MaxDateBS)'}&amp;gt;} [Operation/Activity]) &amp;gt; 1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; ,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;MaxDateBS - Min({$&amp;lt;[Order Type Operaciones] = {'A'},[Actual start (date)]={'&amp;gt;=$(=MinDateBS)&amp;lt;=$(=MaxDateBS)'}&amp;gt;} [Actual start (date)])&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; ) / Count({$&amp;lt;[Order Type Operaciones] = {'A'},[Actual start (date)]={'&amp;gt;=$(=MinDateBS)&amp;lt;=$(=MaxDateBS)'}&amp;gt;} [Operation/Activity])&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; ,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; if (&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Count({$&amp;lt;[Order Type Operaciones] = {'A'},[Actual start (date)]={'&amp;gt;=$(=MinDateBS)&amp;lt;=$(=MaxDateBS)'}&amp;gt;} [Operation/Activity]) = 0&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; ,&lt;STRONG&gt;MaxDateBS - MinDateBS&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; , if (&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count({$&amp;lt;[Order Type Operaciones] = {'A'},[Actual start (date)]={'&amp;gt;=$(=MinDateBS)&amp;lt;=$(=MaxDateBS)'}&amp;gt;}[Operation/Activity]) = 1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,(&lt;STRONG&gt;MaxDateBS - MinDateBS&lt;/STRONG&gt;) / 2&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,0&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; )&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; ))&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; , [Equipment Operaciones]&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; ) &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; )&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;/ Count({$&amp;lt;[Order Type Operaciones] = {'A'}, [Equipment Operaciones]={"=Len(Trim([Equipment Operaciones]))&amp;gt;0"}&amp;gt;} DISTINCT [Equipment Operaciones])&lt;STRONG&gt;,'d') * 24&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 11:22:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185829#M383713</guid>
      <dc:creator />
      <dc:date>2016-09-15T11:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Interval function not working when formatting to hours</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185830#M383714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try applying the interval() function around your complete aggregation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Interval(&lt;/P&gt;&lt;P&gt;Sum(Aggr( ....))&lt;/P&gt;&lt;P&gt;,'h')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 11:41:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185830#M383714</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-15T11:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Interval function not working when formatting to hours</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185831#M383715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Interval function only formats the value as hours. The actual numeric value will still be a fraction of a day. So if you want to calculate with a number hours then you need to multiply it by 24.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 11:45:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185831#M383715</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-09-15T11:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Interval function not working when formatting to hours</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185832#M383716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but why below expressions alone are working ok then?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Interval(MaxDateBS - MinDateBS, 'h') when difference is one day, is returning 24 (hours)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;= Interval(MaxDateBS - MinDateBS, 'd') when difference is one day, is returning 1 (day)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;I do not understand at all.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;but within the big expression it does not work, I need to do what you say:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Interval(MaxDateBS - MinDateBS, 'd') * 24&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;I do not understand what is the difference, why alone is working and within big expression not.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 11:56:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185832#M383716</guid>
      <dc:creator />
      <dc:date>2016-09-15T11:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Interval function not working when formatting to hours</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185833#M383717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's because when you use it in a text box you see the formatted result. If you use it in another expression then the real numeric value is used, not the formatted value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 12:15:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185833#M383717</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-09-15T12:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Interval function not working when formatting to hours</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185834#M383718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;very good explanation, so from my expression, Could I replace Interval(....) by simple difference between dates, that is, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Interval(MaxDateBS - MinDateBS, 'd')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;by:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MaxDateBS - MinDateBS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;and the final result, as it is in days (I supponse &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;MaxDateBS - MinDateBS is in days) multipying it by 24? Would it be correct?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Or another option, multiplying all the Interval results in days by 24¿?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 13:01:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185834#M383718</guid>
      <dc:creator />
      <dc:date>2016-09-15T13:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Interval function not working when formatting to hours</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185835#M383719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's correct. You could also use the interval function around the sum like &lt;A href="https://community.qlik.com/qlik-users/15823"&gt;swuehl&lt;/A&gt;‌posted above. That way the final value is still in fractions of a day, but formatted by the interval function to show as hours. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 17:48:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185835#M383719</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-09-15T17:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Interval function not working when formatting to hours</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185836#M383720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Applying Interval around the sum like Stefan posted is not working in my case. Finally, I have multiplied each&amp;nbsp; Interval(...,'d') within expression by 24. Doing this is working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 21:01:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185836#M383720</guid>
      <dc:creator />
      <dc:date>2016-09-15T21:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Interval function not working when formatting to hours</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185837#M383721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to apply the formatting to the result of the numeric calculation, so in your case to the divison of the sum(Aggr()) and the Count() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried also this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interval() is a formatting function, as already mentioned by Gysbert. It only changes the text representation of a dual value, not the numeric value. Hence it doesn't make sense to use it in inner calculation steps. A following operation may remove the formatting again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, you can format the number 43210 as Date&lt;/P&gt;&lt;P&gt;=Date(43210)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you want to get the following date, &lt;/P&gt;&lt;P&gt;=Date(43210)+1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return the number 43210 again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence only use formatting functions like Date() or Interval() as most outer function / last step in your formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having said this, you are of course free to transform your intervals from the internal numeric representation using fraction of days to hours (multiplying by 24).&lt;/P&gt;&lt;P&gt;It may just make it harder to apply QV date and time functions to these values without doing a division again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 21:15:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185837#M383721</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-15T21:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Interval function not working when formatting to hours</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185838#M383722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I have edit my post, see it below line "'----------------".&amp;nbsp; Using this final solution I have posted works. I have removed inner Intervals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Note that MaxDateBS and MinDateBS are pure dates in the format 'DD/MM/YYYY'. So I&lt;STRONG&gt; suppose difference between MaxDateBS and MinDateBS are always in days, am I right? Could you confirm me this, please? &lt;/STRONG&gt;So the final result will be in hours&lt;STRONG&gt;, so apply I apply interval(Sum(Aggr(....)),'d') * 24&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Using Interval(Sum(Aggr(.......)), &lt;STRONG&gt;'h'&lt;/STRONG&gt;) is not working, that is, not returning value in hours, so I have used &lt;SPAN style="font-size: 13.3333px;"&gt;Interval(Sum(Aggr(.......)),&lt;STRONG&gt; 'd'&lt;/STRONG&gt;) * 24&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 07:53:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-function-not-working-when-formatting-to-hours/m-p/1185838#M383722</guid>
      <dc:creator />
      <dc:date>2016-09-16T07:53:42Z</dc:date>
    </item>
  </channel>
</rss>

