<?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 Qlik Sense Calculation with Missing Data in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313095#M28099</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a calculation in a Qlik Sense application, and am not able to properly do the calculation.&amp;nbsp; The calculation compares current week sales for a restaurant to the prior 4 weeks.&amp;nbsp; The issue is when there is a restaurant that is missing current week sales, but has sales for the prior 4 weeks.&amp;nbsp; When a restaurant is missing current week sales, the prior 4 week sales should be ignored, and this works OK at the restaurant level.&amp;nbsp; However, when calculating totals for a set of restaurants, the same rule applies - the prior 4 week sales for the restaurant missing current week sales should be excluded from the calculation of the totals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an illustration of the problem.&amp;nbsp; In the application, I am getting the results as indicated in the Growth % (Incorrect) column in the table below.&amp;nbsp; However, the calculation should reflect the column Growth % (Correct).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 466px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="60" width="74"&gt;Restaurant&lt;/TD&gt;&lt;TD class="xl67" width="71"&gt;Sales&lt;/TD&gt;&lt;TD class="xl66" width="76"&gt;Trailing 4 Weeks&lt;/TD&gt;&lt;TD class="xl66" width="77"&gt;Growth %&lt;BR /&gt; (Incorrect)&lt;/TD&gt;&lt;TD class="xl66" width="77"&gt;Trailing 4 Weeks for Calc&lt;/TD&gt;&lt;TD class="xl66" width="91"&gt;Growth %&lt;BR /&gt; (Correct)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" width="74"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;500&lt;/TD&gt;&lt;TD align="right" class="xl63" width="76"&gt;549.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;-9.0%&lt;/TD&gt;&lt;TD align="right" class="xl63" width="77"&gt;549.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;-9.0%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" width="74"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl63" width="76"&gt;615.25&lt;/TD&gt;&lt;TD class="xl68"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&lt;/TD&gt;&lt;TD align="right" class="xl63" width="77"&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" width="74"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;546&lt;/TD&gt;&lt;TD align="right" class="xl63" width="76"&gt;480.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;13.7%&lt;/TD&gt;&lt;TD align="right" class="xl63" width="77"&gt;480.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;13.7%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" width="74"&gt;4&lt;/TD&gt;&lt;TD align="right"&gt;845&lt;/TD&gt;&lt;TD align="right" class="xl63" width="76"&gt;698.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;21.0%&lt;/TD&gt;&lt;TD align="right" class="xl63" width="77"&gt;698.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;21.0%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Total&lt;/TD&gt;&lt;TD align="right" class="xl69"&gt;630.33&lt;/TD&gt;&lt;TD align="right" class="xl69"&gt;585.75&lt;/TD&gt;&lt;TD align="right" class="xl70"&gt;&lt;STRONG&gt;7.6%&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl69"&gt;575.92&lt;/TD&gt;&lt;TD align="right" class="xl71"&gt;&lt;STRONG&gt;9.4%&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also attached the application with example data and the calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way I can do this calculation correctly as indicated in the above table?&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;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jul 2017 16:40:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-14T16:40:19Z</dc:date>
    <item>
      <title>Qlik Sense Calculation with Missing Data</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313095#M28099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a calculation in a Qlik Sense application, and am not able to properly do the calculation.&amp;nbsp; The calculation compares current week sales for a restaurant to the prior 4 weeks.&amp;nbsp; The issue is when there is a restaurant that is missing current week sales, but has sales for the prior 4 weeks.&amp;nbsp; When a restaurant is missing current week sales, the prior 4 week sales should be ignored, and this works OK at the restaurant level.&amp;nbsp; However, when calculating totals for a set of restaurants, the same rule applies - the prior 4 week sales for the restaurant missing current week sales should be excluded from the calculation of the totals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an illustration of the problem.&amp;nbsp; In the application, I am getting the results as indicated in the Growth % (Incorrect) column in the table below.&amp;nbsp; However, the calculation should reflect the column Growth % (Correct).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 466px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="60" width="74"&gt;Restaurant&lt;/TD&gt;&lt;TD class="xl67" width="71"&gt;Sales&lt;/TD&gt;&lt;TD class="xl66" width="76"&gt;Trailing 4 Weeks&lt;/TD&gt;&lt;TD class="xl66" width="77"&gt;Growth %&lt;BR /&gt; (Incorrect)&lt;/TD&gt;&lt;TD class="xl66" width="77"&gt;Trailing 4 Weeks for Calc&lt;/TD&gt;&lt;TD class="xl66" width="91"&gt;Growth %&lt;BR /&gt; (Correct)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" width="74"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;500&lt;/TD&gt;&lt;TD align="right" class="xl63" width="76"&gt;549.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;-9.0%&lt;/TD&gt;&lt;TD align="right" class="xl63" width="77"&gt;549.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;-9.0%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" width="74"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl63" width="76"&gt;615.25&lt;/TD&gt;&lt;TD class="xl68"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&lt;/TD&gt;&lt;TD align="right" class="xl63" width="77"&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" width="74"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;546&lt;/TD&gt;&lt;TD align="right" class="xl63" width="76"&gt;480.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;13.7%&lt;/TD&gt;&lt;TD align="right" class="xl63" width="77"&gt;480.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;13.7%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" width="74"&gt;4&lt;/TD&gt;&lt;TD align="right"&gt;845&lt;/TD&gt;&lt;TD align="right" class="xl63" width="76"&gt;698.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;21.0%&lt;/TD&gt;&lt;TD align="right" class="xl63" width="77"&gt;698.25&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;21.0%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Total&lt;/TD&gt;&lt;TD align="right" class="xl69"&gt;630.33&lt;/TD&gt;&lt;TD align="right" class="xl69"&gt;585.75&lt;/TD&gt;&lt;TD align="right" class="xl70"&gt;&lt;STRONG&gt;7.6%&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl69"&gt;575.92&lt;/TD&gt;&lt;TD align="right" class="xl71"&gt;&lt;STRONG&gt;9.4%&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also attached the application with example data and the calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way I can do this calculation correctly as indicated in the above table?&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;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 16:40:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313095#M28099</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-14T16:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Calculation with Missing Data</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313096#M28100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;((Sum({&amp;lt;Week={"201705"}&amp;gt;} Sales)/Count({&amp;lt;[Week]={"201705"}&amp;gt;} distinct Restaurant)/Count({&amp;lt;[Week]={"201705"}&amp;gt;} distinct Week))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(Sum({&amp;lt;Week=,Week={"&amp;gt;=201701 &amp;lt;201705"}, Restaurant = {"=Sum({&amp;lt;Week={201705}&amp;gt;} Sales) &amp;gt; 0"}&amp;gt;} Sales)/Count({&amp;lt;Week=,Week={"&amp;gt;=201701 &amp;lt;201705"}, Restaurant = {"=Sum({&amp;lt;Week={201705}&amp;gt;} Sales) &amp;gt; 0"}&amp;gt;} Restaurant)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(Sum({&amp;lt;Week=,Week={"&amp;gt;=201701 &amp;lt;201705"}, Restaurant = {"=Sum({&amp;lt;Week={201705}&amp;gt;} Sales) &amp;gt; 0"}&amp;gt;} Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count({&amp;lt;Week=,Week={"&amp;gt;=201701 &amp;lt;201705"}, Restaurant = {"=Sum({&amp;lt;Week={201705}&amp;gt;} Sales) &amp;gt; 0"}&amp;gt;} Restaurant))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 17:04:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313096#M28100</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-14T17:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Calculation with Missing Data</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313097#M28101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny, this resolved the issue - thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to Qlik Sense and set analysis, so I am wondering if you could provide an explanation of the set analysis code change you made.&amp;nbsp; In doing some research, I understand you incorporated a function (i.e. &lt;STRONG&gt;Restaurant = {"=Sum({&amp;lt;Week={201705}&amp;gt;} Sales) &amp;gt; 0"}&lt;/STRONG&gt;) in the set analysis.&amp;nbsp; However, I don't understand how it works.&amp;nbsp; When I try to interpret it, I don't get the connection between the summing of Sales for the Week 201705 and the inclusion/exclusion of the Restaurant that meets the criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you could me understand how this works, that would be very helpful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2017 15:47:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313097#M28101</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-17T15:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Calculation with Missing Data</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313098#M28102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That part is just saying that include only those restaurants where Sum({&amp;lt;Week={201705}&amp;gt;} Sales) is greater than 0. Look here for more explanation&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4076"&gt;A Primer on Set Analysis&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The concept we have used is the concept of using search strings within set analysis&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/170437_Capture.PNG" style="height: 132px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2017 15:54:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313098#M28102</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-17T15:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Calculation with Missing Data</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313099#M28103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2017 16:34:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-Sense-Calculation-with-Missing-Data/m-p/1313099#M28103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-17T16:34:02Z</dc:date>
    </item>
  </channel>
</rss>

