<?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 Comparing 2 dates in a pivot table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718592#M258188</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to compare 2 dates to understand the delays from our suppliers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the dates have the DD/MM/YY format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the definition of the pivot table I have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Date#([requested date])- Date#([delivered date]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does NOT work as you can imagine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me: I would like the pivot table to return the sum of the delays for my suppliers (if they are delivering in advance it would be negative)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Aug 2014 06:59:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-08-21T06:59:35Z</dc:date>
    <item>
      <title>Comparing 2 dates in a pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718592#M258188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to compare 2 dates to understand the delays from our suppliers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the dates have the DD/MM/YY format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the definition of the pivot table I have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Date#([requested date])- Date#([delivered date]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does NOT work as you can imagine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me: I would like the pivot table to return the sum of the delays for my suppliers (if they are delivering in advance it would be negative)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 06:59:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718592#M258188</guid>
      <dc:creator />
      <dc:date>2014-08-21T06:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 dates in a pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718593#M258189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try function interval(requested date, delivered date, 'DD/MM/YYYY')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 07:05:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718593#M258189</guid>
      <dc:creator>ecolomer</dc:creator>
      <dc:date>2014-08-21T07:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 dates in a pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718594#M258190</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;If these two fields are already date values, then just subtract the one field from the other:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum([requested date] - [delivered date])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will return the difference in days. If they contain a time portion, then you may want&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Floor([requested date]) - Floor([delivered date]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If they are strings, then I strongly recommend that you convert them to dates when you load them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 07:11:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718594#M258190</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-08-21T07:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 dates in a pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718595#M258191</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;Try like this&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;"&gt;Sum([requested date]- [delivered date])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; 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-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If both the fields are in same table then calculate this in script itself like below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; 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-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&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;"&gt;[requested date]- [delivered date] AS DaysDifference&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;FROM DataSource;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; 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-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Now in expression you can use Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DaysDifference&lt;/SPAN&gt;), this will have better performance.&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;"&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;"&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;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 08:49:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718595#M258191</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-08-21T08:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 dates in a pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718596#M258192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you guys, all your answers are correct. I had an issue with my dates format which is now solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 00:38:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718596#M258192</guid>
      <dc:creator />
      <dc:date>2014-08-22T00:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 dates in a pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718597#M258193</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;Please close this thread by giving Correct Answer and Helpful Answer to the posts which are helpful for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 01:34:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-2-dates-in-a-pivot-table/m-p/718597#M258193</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-08-22T01:34:42Z</dc:date>
    </item>
  </channel>
</rss>

