<?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 if Date1 = Date2 (Reference to another field in Set Analysis) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760671#M270620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What does NewCustomerMonth means in your example? I can understand that it is a date, but does it show the number of months since our customer is with us? What I can imagine is that you want a table with a dimension like NewCustomerMonth,&lt;/P&gt;&lt;P&gt;expressions be like =sum({&amp;lt;SalesMonth='Month1'&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;SalesMonth='Month2'&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;last expression: sum(Sales)&lt;/P&gt;&lt;P&gt;It is not the most elegant solution, on the contrary, but it will work. Let me know if it helped you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Dec 2014 15:03:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-12-18T15:03:52Z</dc:date>
    <item>
      <title>Sum if Date1 = Date2 (Reference to another field in Set Analysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760669#M270618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi out there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perhaps someone can help me with this issue I'm having:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the sales for customers that became new customers a given month and placed orders in following months.&amp;nbsp; So I have two Date-Fields: "NewCustomerMonth" and "SalesMonth"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to summarize the issue in this simplified example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="334"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="138"&gt;Data&lt;/TD&gt;&lt;TD width="106"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;NewCustomerMonth&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;SalesMonth&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;P&gt;100&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the revenues after x months passed for all new customers from Month 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm looking for the following result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 414px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="138"&gt;NewCustomerMonth&lt;/TD&gt;&lt;TD width="106"&gt;Sales in Month1&lt;/TD&gt;&lt;TD width="90"&gt;Sales in Month2&lt;/TD&gt;&lt;TD width="80"&gt;Sales in all Months&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-left: none;"&gt;200&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-left: none;"&gt;100&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-left: none;"&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 414px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="138"&gt;NewCustomerMonth&lt;/TD&gt;&lt;TD width="106"&gt;Sales Month1&lt;/TD&gt;&lt;TD width="90"&gt;Sales Month2&lt;/TD&gt;&lt;TD width="80"&gt;SalesTotal&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-left: none;"&gt;300&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt; &lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried these two ways (in for the first column i.e. "Sales in Month1"):&lt;/P&gt;&lt;P&gt;1. sum( {$ &amp;lt; Key = {"=(SalesMonth = NewCustomerMonth)"} &amp;gt; } Sales)&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;2. sum( {$ &amp;lt; NeukundenKalender._M = p(Kalender._M) &amp;gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get QlikView to sum the Sales "for the SalesMonth equal to the NewCustomerMonth".?&lt;/P&gt;&lt;P&gt;I've also tried plain "IF" but that does not work, because I have not both columns in the Chart (I think it is because of that)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd appreciate if anybody could help or has any ideas... mine have run out expect doing it manually........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Alejandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 13:38:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760669#M270618</guid>
      <dc:creator />
      <dc:date>2014-12-18T13:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if Date1 = Date2 (Reference to another field in Set Analysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760670#M270619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 13:46:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760670#M270619</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-12-18T13:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if Date1 = Date2 (Reference to another field in Set Analysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760671#M270620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What does NewCustomerMonth means in your example? I can understand that it is a date, but does it show the number of months since our customer is with us? What I can imagine is that you want a table with a dimension like NewCustomerMonth,&lt;/P&gt;&lt;P&gt;expressions be like =sum({&amp;lt;SalesMonth='Month1'&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;SalesMonth='Month2'&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;last expression: sum(Sales)&lt;/P&gt;&lt;P&gt;It is not the most elegant solution, on the contrary, but it will work. Let me know if it helped you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 15:03:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760671#M270620</guid>
      <dc:creator />
      <dc:date>2014-12-18T15:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if Date1 = Date2 (Reference to another field in Set Analysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760672#M270621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;NewCustomerMonth is the actual month a customer made its first order, thus becoming a customer.&amp;nbsp; The expressions you proposed do work.&amp;nbsp; But since I have many years of data and need to sum sales "after 3 months of becoming a customer", "after 6 months..."&amp;nbsp; and so on, I was trying to find a way to do it dynamically, in "spoken" formula like this:&lt;/P&gt;&lt;P&gt;Sum of Sales, when SalesMonth = NewCustomerMonth + NewCustomerMonth+1 + NewCustomerMonth+2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Anbu Cheliyan: The use of the second time dimension as columns in a pivot does not help me because there are many other Expressions in the table and I still cannot make partial sums (first 3 months, first 6 months after the date NewCustomerMonth)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Alejandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 16:36:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760672#M270621</guid>
      <dc:creator />
      <dc:date>2014-12-18T16:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if Date1 = Date2 (Reference to another field in Set Analysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760673#M270622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alejandro, did you manage to sort this one out at all? I have exactly the same issue...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 05:10:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760673#M270622</guid>
      <dc:creator />
      <dc:date>2016-11-02T05:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if Date1 = Date2 (Reference to another field in Set Analysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760674#M270623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you to create a new thread with a &lt;STRONG&gt;sample qvw&lt;/STRONG&gt; to work on. You would be offered some useful suggestions by people here, I believe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 05:23:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Date1-Date2-Reference-to-another-field-in-Set-Analysis/m-p/760674#M270623</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2016-11-02T05:23:45Z</dc:date>
    </item>
  </channel>
</rss>

