<?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: When using Total, an expression shows same value for dimension. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275622#M400732</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not working, for example h1, it has different number of measures for both years, when select 2015, some 2014 measure missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2016 15:28:30 GMT</pubDate>
    <dc:creator>fionna51</dc:creator>
    <dc:date>2016-11-18T15:28:30Z</dc:date>
    <item>
      <title>When using Total, an expression shows same value for dimension.</title>
      <link>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275617#M400727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please see my sample application attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to show both current and last year score for each hospital by simple calculation: Score= sum(Numerator * Weight)/sum(Weight) for all measures which a hospital has for the year. Because number of measures may vary each year, I used Total function to get all measures for last year score calculation. Now the expression is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;round&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(=only(Year)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(=only(Year)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Numerator&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)*&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(=only(Year)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Weight&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MeasureID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hospital&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;BR /&gt;&amp;nbsp; / &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(=only(Year)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(=only(Year)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Weight&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) , &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MeasureID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hospital&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;BR /&gt; ,0.1)&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;When I selected any hospital, the calculation is correct, if I don't select any, it defaults to all hospitals and gives me same result for all. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Pic1.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/144278_Pic1.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;If I select any hospital, the result is correct.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="pic2.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/144279_pic2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;I know my use of Total together with Aggr() must exist some problem, please help me to figure it out. Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 13:53:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275617#M400727</guid>
      <dc:creator>fionna51</dc:creator>
      <dc:date>2016-11-18T13:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: When using Total, an expression shows same value for dimension.</title>
      <link>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275618#M400728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what about if you remove the 'TOTAL' from the expression?&lt;/P&gt;&lt;P&gt;like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;round(&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum({&amp;lt;Year={$(=only(Year)-1)}&amp;gt;}Aggr(sum({&amp;lt;Year={$(=only(Year)-1)}&amp;gt;} Numerator)*only({&amp;lt;Year={$(=only(Year)-1)}&amp;gt;} Weight), MeasureID, Hospital))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sum({&amp;lt;Year={$(=only(Year)-1)}&amp;gt;}Aggr(Max({&amp;lt;Year={$(=only(Year)-1)}&amp;gt;}Weight) , MeasureID,Hospital))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,0.1)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 14:22:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275618#M400728</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2016-11-18T14:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: When using Total, an expression shows same value for dimension.</title>
      <link>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275619#M400729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;round&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=only(Year)-1)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Weight&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hospital&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MeasureID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))*&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;( {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=only(Year)-1)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Numerator&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MeasureID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hospital&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MeasureID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hospital&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;BR /&gt; /&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;( {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=only(Year)-1)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Weight&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) , &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MeasureID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hospital&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)),0.1) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;will help you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 14:58:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275619#M400729</guid>
      <dc:creator>stabben23</dc:creator>
      <dc:date>2016-11-18T14:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: When using Total, an expression shows same value for dimension.</title>
      <link>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275620#M400730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all of your help. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 15:27:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275620#M400730</guid>
      <dc:creator>fionna51</dc:creator>
      <dc:date>2016-11-18T15:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: When using Total, an expression shows same value for dimension.</title>
      <link>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275621#M400731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is correct answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 15:27:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275621#M400731</guid>
      <dc:creator>fionna51</dc:creator>
      <dc:date>2016-11-18T15:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: When using Total, an expression shows same value for dimension.</title>
      <link>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275622#M400732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not working, for example h1, it has different number of measures for both years, when select 2015, some 2014 measure missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 15:28:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/When-using-Total-an-expression-shows-same-value-for-dimension/m-p/1275622#M400732</guid>
      <dc:creator>fionna51</dc:creator>
      <dc:date>2016-11-18T15:28:30Z</dc:date>
    </item>
  </channel>
</rss>

