<?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: Sum only if the difference between two fields are greater than a certain amount (30 days). in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421024#M428722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no aggregation calculation in your sub set analysis which is Max, Min, Sum, Count. can you explain the requirement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Sep 2017 05:54:17 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2017-09-27T05:54:17Z</dc:date>
    <item>
      <title>Sum only if the difference between two fields are greater than a certain amount (30 days).</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421022#M428720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; font-size: 9pt; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-ansi-language: EN-AU; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA;"&gt;how to use expression to Sum only if the difference between two fields are greater than a certain amount (30 days). Say if the two fields are paymentdate and invoice date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; font-size: 9pt; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-ansi-language: EN-AU; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA;"&gt;I have tried &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;[Payment Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;"&amp;gt;=[Invoice Date]+30"&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;Amount&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 03:38:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421022#M428720</guid>
      <dc:creator>ronaldwang</dc:creator>
      <dc:date>2017-09-27T03:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum only if the difference between two fields are greater than a certain amount (30 days).</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421023#M428721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;try,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;[Payment Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;"&amp;gt;=$(=date(max([Invoice Date])+30))"&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;Amount&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 03:41:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421023#M428721</guid>
      <dc:creator>shraddha_g</dc:creator>
      <dc:date>2017-09-27T03:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sum only if the difference between two fields are greater than a certain amount (30 days).</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421024#M428722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no aggregation calculation in your sub set analysis which is Max, Min, Sum, Count. can you explain the requirement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 05:54:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421024#M428722</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-09-27T05:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sum only if the difference between two fields are greater than a certain amount (30 days).</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421025#M428723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #17365d; font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-bidi-font-size: 11.0pt; mso-themecolor: text2; mso-themeshade: 191;"&gt;The requirement is that for a number of transactions (where&amp;nbsp; [invoice date] and [Payment date] is 2 of the fields. And I want to add up the amount where the difference between the [invoice date] and [Payment date] is less than 30 days. (based on the assumption that I am not to load the [Payment date]-[invoice date] into my data model. thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 06:01:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421025#M428723</guid>
      <dc:creator>ronaldwang</dc:creator>
      <dc:date>2017-09-27T06:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sum only if the difference between two fields are greater than a certain amount (30 days).</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421026#M428724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;&lt;SPAN style="color: #17365d; font-family: Verdana, sans-serif; font-size: 13.3333px;"&gt;[invoice date] = {"=(&lt;SPAN style="color: #17365d; font-family: Verdana, sans-serif; font-size: 13.3333px;"&gt;[invoice date] - [Payment date]) &amp;lt; 30&lt;/SPAN&gt;"}&lt;/SPAN&gt;&amp;gt;} Amount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In script, create one flag&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If(&lt;SPAN style="color: #17365d; font-family: Verdana, sans-serif; font-size: 13.3333px;"&gt;[invoice date] - [Payment date] &amp;lt; 30, 1, 0) as Flag&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #17365d; font-family: Verdana, sans-serif; font-size: 13.3333px;"&gt;OR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #17365d; font-family: Verdana, sans-serif; font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;If(NetWorkDays(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #17365d; font-size: 13.3333px; font-family: Verdana, sans-serif;"&gt;[invoice date] - [Payment date]) &amp;lt; 30, 1, 0) as Flag&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #17365d; font-family: Verdana, sans-serif; font-size: 13.3333px;"&gt;And set analysis should be&lt;/SPAN&gt;&lt;STRONG style="color: #17365d; font-size: 13.3333px; font-family: Verdana, sans-serif;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #17365d; font-family: Verdana, sans-serif; font-size: 13.3333px;"&gt;&lt;STRONG&gt;Sum({&amp;lt;Flag = {1}&amp;gt;} Amount)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 06:27:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421026#M428724</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-09-27T06:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sum only if the difference between two fields are greater than a certain amount (30 days).</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421027#M428725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the first option is not working and probably I have to go to change the datamart to flag it. thanks Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 06:45:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421027#M428725</guid>
      <dc:creator>ronaldwang</dc:creator>
      <dc:date>2017-09-27T06:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sum only if the difference between two fields are greater than a certain amount (30 days).</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421028#M428726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume, First one also should work. Might this problem with Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Interval(Date(Date#(&lt;/STRONG&gt;&lt;STRONG style=": ; color: #17365d; font-style: inherit; font-size: 13.3333px; font-family: Verdana, sans-serif; font-weight: inherit;"&gt;&lt;STRONG&gt;[invoice date],'Having Format'),'Required Format') - &lt;SPAN style="font-size: 13.3333px;"&gt;Date(Date#(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG style="color: #17365d; font-size: 13.3333px; font-style: inherit; font-family: Verdana, sans-serif; font-weight: inherit;"&gt;&lt;STRONG&gt;[Payment&lt;/STRONG&gt; date],'Having Format'),'Required Format')&lt;/STRONG&gt;, 'DD') &amp;lt; 30, 1, 0)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 06:49:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421028#M428726</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-09-27T06:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum only if the difference between two fields are greater than a certain amount (30 days).</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421029#M428727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Anil, it is working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 06:58:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-only-if-the-difference-between-two-fields-are-greater-than-a/m-p/1421029#M428727</guid>
      <dc:creator>ronaldwang</dc:creator>
      <dc:date>2017-09-27T06:58:17Z</dc:date>
    </item>
  </channel>
</rss>

