<?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: Table should show rows with several contract types, but does not for calculated measure in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Table-should-show-rows-with-several-contract-types-but-does-not/m-p/957760#M13670</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like you to put both the numerator and the denominator for this expression as 2 new measures in your table broken out by contract.&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum (Contract_Counter) / Sum({&amp;lt; Contract_Type =&amp;nbsp; &amp;gt;} Vehicle_Sales)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;My sense is that the denominator is evaluating to null and causing the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may depend on your data model (so i'm not 100% sure) but you could also try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum (Contract_Counter) / Sum( total &amp;lt;Contract&amp;gt; {&amp;lt; Contract_Type =&amp;nbsp; &amp;gt;} Vehicle_Sales)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Dec 2015 17:01:06 GMT</pubDate>
    <dc:creator>JonnyPoole</dc:creator>
    <dc:date>2015-12-18T17:01:06Z</dc:date>
    <item>
      <title>Table should show rows with several contract types, but does not for calculated measure</title>
      <link>https://community.qlik.com/t5/App-Development/Table-should-show-rows-with-several-contract-types-but-does-not/m-p/957759#M13669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been trying to solve the Problem below for quite some time now. Can anyone please help me with this issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my Qlik Sense app I have the following 3 measures:&lt;/P&gt;&lt;P&gt;1. New Contracts: &lt;EM&gt;Sum (Contract_Counter)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;2. Vehicle_Sales: &lt;EM&gt;Sum({&amp;lt; Contract_Type =&amp;nbsp; &amp;gt;} Vehicle_Sales) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;3. Penetration_Rate: &lt;EM&gt;Sum (Contract_Counter) / Sum({&amp;lt; Contract_Type =&amp;nbsp; &amp;gt;} Vehicle_Sales) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now we have 3 dimensions:&lt;/P&gt;&lt;P&gt;1. Date&lt;/P&gt;&lt;P&gt;2. Vehicle_Type&lt;/P&gt;&lt;P&gt;3. Contract_Type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTRACT details cover all 3 dimensions, while VEHICLE details only cover Date and Vehicle_Type.&lt;/P&gt;&lt;P&gt;Therefore I have to use set analysis for the Vehicle_Sales formula to ignore any selection made on Contract Type:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sum({&amp;lt; Contract_Type =&amp;nbsp; &amp;gt;} Vehicle_Sales) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Penetration_Rate formula works fine as long as we are on top Level, i.e. we do not show any contract types:&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/109445_pastedImage_9.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, if I select a specific contract type (e.g. "Full Maintenance"), the result is correct:&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/109446_pastedImage_10.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT, if I want to show the Penetration per contract type in a table or pivot table, the result looks as follows: &lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-7" src="https://community.qlik.com/legacyfs/online/109452_pastedImage_17.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I select "Full Maintenance" the table looks like:&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-6" src="https://community.qlik.com/legacyfs/online/109451_pastedImage_16.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;In both cases the total figures 23.1% and 5.9% are correct, but the rows in the table are not filled out.&lt;/P&gt;&lt;P&gt;As far as I understand Qlik Sense, all rows are correct:&lt;/P&gt;&lt;P&gt;Full Maintenance is "-" because we have e.g. 59 contracts, but no vehicle sales on that contract type. Also the "-" row is correct, because we have 0 contracts without contract type, but 1000 vehicle sales.&lt;/P&gt;&lt;P&gt;In total the 5.9% Penetration is calculated, because across all contract types we have 59 contracts and 1000 vehicle sales = 5.9%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I do to get a table like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-5 jive-image" src="https://community.qlik.com/legacyfs/online/109450_pastedImage_15.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance for your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Michael &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 13:55:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Table-should-show-rows-with-several-contract-types-but-does-not/m-p/957759#M13669</guid>
      <dc:creator />
      <dc:date>2015-12-18T13:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Table should show rows with several contract types, but does not for calculated measure</title>
      <link>https://community.qlik.com/t5/App-Development/Table-should-show-rows-with-several-contract-types-but-does-not/m-p/957760#M13670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like you to put both the numerator and the denominator for this expression as 2 new measures in your table broken out by contract.&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum (Contract_Counter) / Sum({&amp;lt; Contract_Type =&amp;nbsp; &amp;gt;} Vehicle_Sales)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;My sense is that the denominator is evaluating to null and causing the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may depend on your data model (so i'm not 100% sure) but you could also try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum (Contract_Counter) / Sum( total &amp;lt;Contract&amp;gt; {&amp;lt; Contract_Type =&amp;nbsp; &amp;gt;} Vehicle_Sales)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 17:01:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Table-should-show-rows-with-several-contract-types-but-does-not/m-p/957760#M13670</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-12-18T17:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Table should show rows with several contract types, but does not for calculated measure</title>
      <link>https://community.qlik.com/t5/App-Development/Table-should-show-rows-with-several-contract-types-but-does-not/m-p/957761#M13671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jonathan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your answer and sorry for my late response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a "total" to my Vehicle_Sales formula. This works fine for total views:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/111358_pastedImage_8.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/111351_pastedImage_3.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, as soon as I show a detailed view per vehicle type, e.g. in a pivot table, the calculation is wrong for each vehicle type. The amount of contracts for each vehicle type is always divided by the total amount of vehicle sales (regardless of their type):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/111356_pastedImage_5.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I select Vehicle_1, the calculation is correct, but without any vehicle selection it is wrong:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-4" src="https://community.qlik.com/legacyfs/online/111362_pastedImage_9.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that one can limit the "total" in the aggregate function like e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-5 jive-image" src="https://community.qlik.com/legacyfs/online/111363_pastedImage_11.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if I do so, the result for Vehicle Sales is always Zero and Penetration is "-".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a small demo app which should show the problem, &lt;STRONG&gt;but I do not know how to attach the file.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this app we have a data model with LINK_TABLE, YearBridge and MasterCalendar. These are needed, because they exist in our "real" app as well (due to 10 different date fields that must be addressed by 1 MasterDate ...and a Date Type):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-6" src="https://community.qlik.com/legacyfs/online/111364_pastedImage_16.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea how to solve this Problem?&lt;/P&gt;&lt;P&gt;How can I attach demo apps?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2016 10:17:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Table-should-show-rows-with-several-contract-types-but-does-not/m-p/957761#M13671</guid>
      <dc:creator />
      <dc:date>2016-01-12T10:17:31Z</dc:date>
    </item>
  </channel>
</rss>

