<?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 Interval and Number comparison in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073218#M17596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a time interval declared at load &lt;SPAN style="font-size: 13.3333px;"&gt;which shows the difference between the entry and exit time in minutes:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval([ExitedTime]-[EnteredTime],'mm') As [DurationActual]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And a [Duration] field which has set amounts of 15, 30, 45, 60, 75 and 90 representing minutes allotted to a client.&lt;/P&gt;&lt;P&gt;I wanted to compare the two to show whether a client stayed within their allotted time allowance and use a background colour expression to indicate if they were over or under:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([DurationActual]&amp;gt;[Duration],red(),green())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This always shows as green though even when DurationActual is higher than the Duration. I'm thinking it is an issue with the formatting when comparing the two. Can anyone advise on how to convert either of them into comparable formats?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Mar 2016 13:56:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-03-02T13:56:42Z</dc:date>
    <item>
      <title>Interval and Number comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073218#M17596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a time interval declared at load &lt;SPAN style="font-size: 13.3333px;"&gt;which shows the difference between the entry and exit time in minutes:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval([ExitedTime]-[EnteredTime],'mm') As [DurationActual]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And a [Duration] field which has set amounts of 15, 30, 45, 60, 75 and 90 representing minutes allotted to a client.&lt;/P&gt;&lt;P&gt;I wanted to compare the two to show whether a client stayed within their allotted time allowance and use a background colour expression to indicate if they were over or under:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([DurationActual]&amp;gt;[Duration],red(),green())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This always shows as green though even when DurationActual is higher than the Duration. I'm thinking it is an issue with the formatting when comparing the two. Can anyone advise on how to convert either of them into comparable formats?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 13:56:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073218#M17596</guid>
      <dc:creator />
      <dc:date>2016-03-02T13:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Interval and Number comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073219#M17597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you could try putting NUM around both (either in the expression or the load script):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUM(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; Interval([ExitedTime]-[EnteredTime],'mm')) &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;NUM([Duration])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that is assuming you have already linked [Duration] to the tables some how (so there is only one [Duration] to compare against)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 15:23:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073219#M17597</guid>
      <dc:creator />
      <dc:date>2016-03-02T15:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Interval and Number comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073220#M17598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 15:27:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073220#M17598</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-02T15:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Interval and Number comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073221#M17599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below.&lt;/P&gt;&lt;P&gt;Since Qliksense doesn't actually let me change the colour of a normal column you'll see I've got duration as a calculation here as well but the if statement in the colour change is the issue. DurationActual shows the exact same values as Duration(Actual) column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="116650" alt="CaptureTime.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/116650_CaptureTime.PNG" style="height: 379px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 15:32:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073221#M17599</guid>
      <dc:creator />
      <dc:date>2016-03-02T15:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Interval and Number comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073222#M17600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;INTERVAL returns a fraction to represent time - it just makes it look like a minute representation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. if you put NUM around the interval, you will see a completely different number to without it. You could try multiplying [DurationActual] * 24 * 60&lt;/P&gt;&lt;P&gt;although you run the risk of having fractional variance in the value it returns.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 15:47:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073222#M17600</guid>
      <dc:creator />
      <dc:date>2016-03-02T15:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Interval and Number comparison</title>
      <link>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073223#M17601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This fixed it! Thanks Andrew. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([DurationActual]*24*60&amp;gt;[Duration],red(),green())&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 15:51:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Interval-and-Number-comparison/m-p/1073223#M17601</guid>
      <dc:creator />
      <dc:date>2016-03-02T15:51:16Z</dc:date>
    </item>
  </channel>
</rss>

