<?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: IF statement to deal with duplicates within fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/IF-statement-to-deal-with-duplicates-within-fields/m-p/438554#M702387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that, I'll give that a try now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way the above can be used if you have more than two duplicate IDs?&amp;nbsp; If yes, then is it possible to get the difference between max and min times?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Sep 2012 14:58:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-09-25T14:58:33Z</dc:date>
    <item>
      <title>IF statement to deal with duplicates within fields</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-to-deal-with-duplicates-within-fields/m-p/438551#M702384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to do calculations based on duplicates within the same field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="387"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="21" width="89"&gt;Date&lt;/TD&gt;&lt;TD width="80"&gt;Time&lt;/TD&gt;&lt;TD width="80"&gt;ID&lt;/TD&gt;&lt;TD width="138"&gt;Desc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="21"&gt;11/01/2012&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;12:20 PM&lt;/TD&gt;&lt;TD align="right"&gt;1100007&lt;/TD&gt;&lt;TD&gt;Alloc &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="21"&gt;11/01/2012&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;12:17 PM&lt;/TD&gt;&lt;TD align="right"&gt;1100007&lt;/TD&gt;&lt;TD&gt;Alloc &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need to do is, if the IDs are the same (i.e. 1100007 = 1100007) and the Desc's are the same (i.e. Alloc = Alloc), then work out the absolute difference of the "Time" field (which is 3 minutes in this example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure what syntax to use which will enable me to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 12:39:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-to-deal-with-duplicates-within-fields/m-p/438551#M702384</guid>
      <dc:creator />
      <dc:date>2012-09-25T12:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement to deal with duplicates within fields</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-to-deal-with-duplicates-within-fields/m-p/438552#M702385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that you load the table in correct order (ID, Desc, Date) and you are having always a pair of rows, if they are equal in (ID, Desc, Date). With this requirements try to use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TT:&lt;/P&gt;&lt;P&gt;// Table is loaded in sort order&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join(TT)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Previous(ID) = ID and Previous(Date) = Date and Previous(Desc) = Desc, Value+Previous(Value), 0) as SumVal&lt;/P&gt;&lt;P&gt;Resident TT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HtH&lt;/P&gt;&lt;P&gt;Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 14:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-to-deal-with-duplicates-within-fields/m-p/438552#M702385</guid>
      <dc:creator />
      <dc:date>2012-09-25T14:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement to deal with duplicates within fields</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-to-deal-with-duplicates-within-fields/m-p/438553#M702386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using the "ABOVE" statement in order to check the previous row&amp;nbsp; of "ID" and "Desc"&lt;/P&gt;&lt;P&gt;for comparing with current row and based on this condition find the difference&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 14:43:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-to-deal-with-duplicates-within-fields/m-p/438553#M702386</guid>
      <dc:creator />
      <dc:date>2012-09-25T14:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement to deal with duplicates within fields</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-to-deal-with-duplicates-within-fields/m-p/438554#M702387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that, I'll give that a try now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way the above can be used if you have more than two duplicate IDs?&amp;nbsp; If yes, then is it possible to get the difference between max and min times?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 14:58:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-to-deal-with-duplicates-within-fields/m-p/438554#M702387</guid>
      <dc:creator />
      <dc:date>2012-09-25T14:58:33Z</dc:date>
    </item>
  </channel>
</rss>

