<?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 CALCULATE TOTAL RATIO WITH SOME DATA = 0 in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/CALCULATE-TOTAL-RATIO-WITH-SOME-DATA-0/m-p/1373816#M31016</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;let me introduce my issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="structure.png" class="jive-image image-1" height="221" src="https://community.qlik.com/legacyfs/online/178185_structure.png" style="height: 221.283px; width: 301px;" width="301" /&gt; As you see in these entreprise, there are 2 categories of employees :&lt;/P&gt;&lt;P&gt;COM who produces sales&lt;/P&gt;&lt;P&gt;STAFF who does'nt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course the 2 categories consume hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to calculate the ratio SALES per HOUR&amp;nbsp; for each sector and total&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i use this expression :&lt;/P&gt;&lt;P&gt;If(Sum(SALES) = 0, Sum(TOTAL SALES)/ Sum(HOURS), Sum(SALES)/Sum(HOURS))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(to simplify i took a simple example without needding Aggr &amp;amp; dimensionnality ()=0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;A&lt;STRONG&gt;s you see, for staff i need total sales to calculate the ratio:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="TOTAL.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/178186_TOTAL.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here comes my issue :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i have to analyse one COM sector together with one STAFF sector the result is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="partiel.png" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/178196_partiel.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;As you see the ratio is correct for total and COM but not for STAFF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need the expression to &lt;STRONG style="text-decoration: underline;"&gt;"freeze" the total SALES&lt;/STRONG&gt;&amp;nbsp; independently of sector's selection ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know the expression for that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hoping some help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Sep 2017 17:40:29 GMT</pubDate>
    <dc:creator>philgood34</dc:creator>
    <dc:date>2017-09-29T17:40:29Z</dc:date>
    <item>
      <title>CALCULATE TOTAL RATIO WITH SOME DATA = 0</title>
      <link>https://community.qlik.com/t5/App-Development/CALCULATE-TOTAL-RATIO-WITH-SOME-DATA-0/m-p/1373816#M31016</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;let me introduce my issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="structure.png" class="jive-image image-1" height="221" src="https://community.qlik.com/legacyfs/online/178185_structure.png" style="height: 221.283px; width: 301px;" width="301" /&gt; As you see in these entreprise, there are 2 categories of employees :&lt;/P&gt;&lt;P&gt;COM who produces sales&lt;/P&gt;&lt;P&gt;STAFF who does'nt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course the 2 categories consume hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to calculate the ratio SALES per HOUR&amp;nbsp; for each sector and total&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i use this expression :&lt;/P&gt;&lt;P&gt;If(Sum(SALES) = 0, Sum(TOTAL SALES)/ Sum(HOURS), Sum(SALES)/Sum(HOURS))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(to simplify i took a simple example without needding Aggr &amp;amp; dimensionnality ()=0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;A&lt;STRONG&gt;s you see, for staff i need total sales to calculate the ratio:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="TOTAL.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/178186_TOTAL.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here comes my issue :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i have to analyse one COM sector together with one STAFF sector the result is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="partiel.png" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/178196_partiel.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;As you see the ratio is correct for total and COM but not for STAFF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need the expression to &lt;STRONG style="text-decoration: underline;"&gt;"freeze" the total SALES&lt;/STRONG&gt;&amp;nbsp; independently of sector's selection ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know the expression for that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hoping some help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 17:40:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/CALCULATE-TOTAL-RATIO-WITH-SOME-DATA-0/m-p/1373816#M31016</guid>
      <dc:creator>philgood34</dc:creator>
      <dc:date>2017-09-29T17:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: CALCULATE TOTAL RATIO WITH SOME DATA = 0</title>
      <link>https://community.qlik.com/t5/App-Development/CALCULATE-TOTAL-RATIO-WITH-SOME-DATA-0/m-p/1373817#M31017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;got it !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Sum(SALES) = 0, Sum(&lt;SPAN style="background: yellow;"&gt;{1}&lt;/SPAN&gt;TOTAL SALES)/ Sum(HOURS), Sum(SALES)/Sum(HOURS))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope it will be useful for other new users&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 19:47:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/CALCULATE-TOTAL-RATIO-WITH-SOME-DATA-0/m-p/1373817#M31017</guid>
      <dc:creator>philgood34</dc:creator>
      <dc:date>2017-09-29T19:47:41Z</dc:date>
    </item>
  </channel>
</rss>

