<?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: Set analysis calculation for every month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373118#M138748</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The calendar key is, as I said, a numeric field (see below). This Calendar_Key is in the Order table instead of Calendar_Date. But this doesnt matter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Calendar_Key&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Reference_Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;04.04.2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;01.05.2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I've tried it without Only but didnt work either. No result will be calculated then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to be very accurately with the days und months. So, the average or something like that is not a possible solution for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Mar 2012 10:26:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-03-28T10:26:08Z</dc:date>
    <item>
      <title>Set analysis calculation for every month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373114#M138744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table like the following (I've reduced the calendar date to a single field; in my app it's an calendar table):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Project_ID&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Calendar_Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Order_Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;04.04.2012&lt;/TD&gt;&lt;TD&gt;20.05.2012&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;04.04.2012&lt;/TD&gt;&lt;TD&gt;13.12.2012&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;04.04.2012&lt;/TD&gt;&lt;TD&gt;06.09.2012&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;01.05.2012&lt;/TD&gt;&lt;TD&gt;09.05.2012&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;01.05.2012&lt;/TD&gt;&lt;TD&gt;01.01.2013&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what I'm trying to achieve is a chart which calculates the sum of amount for every month within a specific range. Here, there are all values where the Order_Date is less than or equal to (Calendar_Date + 6 months). On base of this statement I have developed the following formula: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;Order_Date={"&amp;lt;=$(=AddMonths(MakeDate(Only(Year), Only(Month), 1),3))"}&amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year and Month are fields from the calendar table. I know that a result will be shown only when a specific calendar date is selected because of the Only function. But I would have a chart where a result is calulcated for every calendar date respectively the unique month which is the dimenion of that chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Philipp&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #00b400; font-size: 8pt;"&gt;&lt;STRONG style="color: #00b400; font-size: 8pt;"&gt; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 07:36:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373114#M138744</guid>
      <dc:creator />
      <dc:date>2012-03-28T07:36:09Z</dc:date>
    </item>
    <item>
      <title>Set analysis calculation for every month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373115#M138745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Philipp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is your field Calendar_Date really existing, if notI would create it and use it :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would then transform this field into a numeric value and add 180 (days) &amp;lt;=&amp;gt; 6 months&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would write a formula like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;=Sum({$&amp;lt;Order_Date={"&amp;lt;=$(=Num(Calendar_Date)+90))"}&amp;gt;} Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may,have also to create a numeric field of the Order_Date field :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;=Sum({$&amp;lt;Order_Date_Num={"&amp;lt;=$(=Num(Calendar_Date)+90))"}&amp;gt;} Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kévin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 08:48:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373115#M138745</guid>
      <dc:creator />
      <dc:date>2012-03-28T08:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis calculation for every month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373116#M138746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it exists. But in my application it's a key field (numeric field) to the calendar table which contains the calendar date. I have made the example table only to simplify my aim.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, adding a numeric value to the dates isnt really what I want. By the way, 180 days are unequal to 6 months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 09:00:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373116#M138746</guid>
      <dc:creator />
      <dc:date>2012-03-28T09:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis calculation for every month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373117#M138747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you describe the key linking your calendar and your Order table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the key is a date with a numeric format I would test this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;Sum({$&amp;lt;Order_Date={"&amp;lt;=$(=AddMonths(Date(Key)),3))"}&amp;gt;} Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm also not sure that you need to use the function Only, have you test without it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About 180 days = 6 months, you have in average 30 days in a month, so 30*6 = 180, after it depends how accurate you want to be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kévin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 09:39:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373117#M138747</guid>
      <dc:creator />
      <dc:date>2012-03-28T09:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis calculation for every month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373118#M138748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The calendar key is, as I said, a numeric field (see below). This Calendar_Key is in the Order table instead of Calendar_Date. But this doesnt matter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Calendar_Key&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Reference_Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;04.04.2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;01.05.2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I've tried it without Only but didnt work either. No result will be calculated then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to be very accurately with the days und months. So, the average or something like that is not a possible solution for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 10:26:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373118#M138748</guid>
      <dc:creator />
      <dc:date>2012-03-28T10:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis calculation for every month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373119#M138749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need to use the Only function, it seems that for 1 OrderDate, you have many CalendarDate. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could replace Only by Max but for me it is not what you want. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 12:38:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373119#M138749</guid>
      <dc:creator />
      <dc:date>2012-03-28T12:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis calculation for every month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373120#M138750</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;I made it. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I reworked my data model in such way that the order table now contains additional fields for the time range and the amount. So, the "new" amount will be calculated only when it is in the range which you can specify in the script part. Overall, I've made this by scripting the following lines of code:&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Let vRange = 3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do While vRange &amp;lt;= 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Orders_tmp2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAmount * ChanceOfOrder as WeightedAmount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vRange) as Range,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Order_Date &amp;lt;= AddMonths(Date(Calendar_Date), $(vRange)), Amount) as RangeAmount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident&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; Orders_tmp1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vRange = vRange * 2;&lt;/P&gt;&lt;P&gt;Loop﻿&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;Oh, I forgot... ChanceOfOrder is an additional field in the Order table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this solution I could removed the set analysis date formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps any other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 06:17:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-calculation-for-every-month/m-p/373120#M138750</guid>
      <dc:creator />
      <dc:date>2012-03-29T06:17:11Z</dc:date>
    </item>
  </channel>
</rss>

