<?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 Expression to shared costs in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122564#M908374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm&amp;nbsp; trying to create an expression dividing the total cost per number of resources. The problem on doing this is becase there is no link between Unique Resource ID Field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attaching a spreadsheet with the expression result I'd like to have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you help me?&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/128005_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>silvia_assuncao</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Expression to shared costs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122564#M908374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm&amp;nbsp; trying to create an expression dividing the total cost per number of resources. The problem on doing this is becase there is no link between Unique Resource ID Field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attaching a spreadsheet with the expression result I'd like to have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you help me?&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/128005_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122564#M908374</guid>
      <dc:creator>silvia_assuncao</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to shared costs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122565#M908375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=If([Acconts Qt] &amp;gt; 0,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(TOTAL Aggr(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;( Sum(If([Adjust Type]='C' and [Adjust Signal]='-',([Adjust Amount]*(-1)/100))))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; + Sum(If([Adjust Type]='C' and [Adjust Signal]='+',([Adjust Amount]/100)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; +Sum(If([Discount Type]='C' and [Discount Signal]='-',([Discount Amount]*(-1))/100))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; + Sum(If([Plan Type]='C' and [Registry ID] = '60',[Plan Amount with Taxes])/100)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; , [Unique Account ID], [Unique Resource ID]))/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; Sum(TOTAL Aggr(Count(Distinct(if(left([Unique Resource ID],1)&amp;lt;&amp;gt;' ' and left([Unique Resource ID],1)&amp;lt;&amp;gt;'',[Unique Resource ID])))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; , [Unique Account ID], [Unique Resource ID])))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG __jive_id="128013" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/128013_Capture.PNG" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:07:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122565#M908375</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-15T18:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to shared costs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122566#M908376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rangesum( &lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({&amp;lt;[Adjust Type]={'C'}, [Adjust Signal]={'-'}&amp;gt;} total [Adjust Amount]*(-1))&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Sum({&amp;lt;[Adjust Type]={'C'}, [Adjust Signal]={'+'}&amp;gt;} total [Adjust Amount])&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Sum({&amp;lt;[Discount Type]={'C'}, [Discount Signal]={'-'}&amp;gt;} total [Discount Amount]*(-1))&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Sum({&amp;lt;[Plan Type]={'C'}, [Registry ID] = {'60'}&amp;gt;} total [Plan Amount with Taxes])&lt;/P&gt;&lt;P&gt; )&lt;/P&gt;&lt;P&gt;/ 100 &lt;/P&gt;&lt;P&gt;/ sum(total aggr(Count({&amp;lt;[Unique Resource ID]={"=Len(Trim([Unique Resource ID]))&amp;gt;0"}&amp;gt;} Distinct [Unique Resource ID]), [Unique Account ID], [Unique Resource ID]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make things a bit easier you could create multiplier fields for the signal fields with values -1 and 1. That way you don't have to test the value of the xxx Signal fields and manually add a multiplier. You can simply multiple with the multiplier field you created in the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:22:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122566#M908376</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-06-15T18:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to shared costs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122567#M908377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny, this solves 99%, but what could be done so that in the total value we would vale to real sum (40,833)?&lt;/P&gt;&lt;P&gt;Thanks a lot for your help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:27:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122567#M908377</guid>
      <dc:creator>silvia_assuncao</dc:creator>
      <dc:date>2016-06-15T18:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to shared costs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122568#M908378</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(Aggr(If(Count(Distinct(if(left([Unique Resource ID],1)&amp;lt;&amp;gt;' ' and left([Unique Resource ID],1)&amp;lt;&amp;gt;'',[Unique Resource ID]))) &amp;gt; 0,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(TOTAL Aggr(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;( Sum(If([Adjust Type]='C' and [Adjust Signal]='-',([Adjust Amount]*(-1)/100))))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; + Sum(If([Adjust Type]='C' and [Adjust Signal]='+',([Adjust Amount]/100)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; +Sum(If([Discount Type]='C' and [Discount Signal]='-',([Discount Amount]*(-1))/100))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; + Sum(If([Plan Type]='C' and [Registry ID] = '60',[Plan Amount with Taxes])/100)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; , [Unique Account ID], [Unique Resource ID]))/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; Sum(TOTAL Aggr(Count(Distinct(if(left([Unique Resource ID],1)&amp;lt;&amp;gt;' ' and left([Unique Resource ID],1)&amp;lt;&amp;gt;'',[Unique Resource ID])))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; , [Unique Account ID], [Unique Resource ID]))), [Unique Account ID], [Unique Resource ID]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/128014_Capture.PNG" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:39:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122568#M908378</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-15T18:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to shared costs</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122569#M908379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes!!!! Totally worked!! Thanks a lot!!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:24:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-shared-costs/m-p/1122569#M908379</guid>
      <dc:creator>silvia_assuncao</dc:creator>
      <dc:date>2016-06-15T19:24:23Z</dc:date>
    </item>
  </channel>
</rss>

