<?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: Variables with sum and filters in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842350#M469585</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for reply. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; Your answer is the best as for me - you've also showed me that I can use &lt;EM&gt;Alt&lt;/EM&gt; function to avoid errors (I think that this is for that ;p).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jun 2015 07:42:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-06-30T07:42:16Z</dc:date>
    <item>
      <title>Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842341#M469576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have such variable (in Variable Overview): &lt;EM&gt;vCost = SUM([Cost1])+SUM([Cost2]).&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I want do sth like this (in Chart Properties -&amp;gt; Expressions -&amp;gt; Definition): &lt;EM&gt;SUM( {&amp;lt;[Some dimension]={'Option1'}&amp;gt;} vCost) - &lt;/EM&gt;but I see that it is not correct. So my question is how to get filtered variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Monika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 11:41:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842341#M469576</guid>
      <dc:creator />
      <dc:date>2015-06-29T11:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842342#M469577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Monica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to add [Cost1] + [Cost2] in the variable, so without the SUM().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greets, Halmar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 11:46:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842342#M469577</guid>
      <dc:creator>qlikhalmar</dc:creator>
      <dc:date>2015-06-29T11:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842343#M469578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Monika, you can change to vCost variable to:&lt;/P&gt;&lt;P&gt;Alt(Cost1,0)+Alt(Cost2,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then you can use those expressions:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SUM({&amp;lt;[Some dimension]={'Option1'}&amp;gt;} $(vCost))&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 11:50:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842343#M469578</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-06-29T11:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842344#M469579</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In variable&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(&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; {&amp;lt;[Some dimension]={'Option1'}&amp;gt;} &lt;/EM&gt;[Cost1])+SUM(&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; {&amp;lt;[Some dimension]={'Option1'}&amp;gt;} &lt;/EM&gt;[Cost2])&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;And use vCost as expression.&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;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Or&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;Directly use as&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(&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; {&amp;lt;[Some dimension]={'Option1'}&amp;gt;} &lt;/EM&gt;[Cost1])+SUM(&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; {&amp;lt;[Some dimension]={'Option1'}&amp;gt;} &lt;/EM&gt;[Cost2]) in expression&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 11:52:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842344#M469579</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2015-06-29T11:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842345#M469580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for answer but it's too much writing as for me. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 11:54:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842345#M469580</guid>
      <dc:creator />
      <dc:date>2015-06-29T11:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842346#M469581</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;Its coming from same table?&lt;/P&gt;&lt;P&gt;If so, &lt;/P&gt;&lt;P&gt;You can write like this'&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;SUM(&lt;EM style="font-weight: inherit;"&gt; {&amp;lt;[Some dimension]={'Option1'}&amp;gt;} &lt;/EM&gt;[Cost1] +&lt;EM style="font-weight: inherit;"&gt; &lt;/EM&gt;[Cost2]) &lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 12:08:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842346#M469581</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2015-06-29T12:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842347#M469582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Monica ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dont declare variable with '=' i mean just write (SUM([Cost1])+SUM([Cost2])) like this in variable Overview(That means it will consider it as text)&lt;/P&gt;&lt;P&gt;&amp;amp; in Expression Change to vCost to $(vCost) u will get the correct ans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 12:42:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842347#M469582</guid>
      <dc:creator />
      <dc:date>2015-06-29T12:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842348#M469583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I know. I used '=' just to show how variable vCost looks like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 07:33:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842348#M469583</guid>
      <dc:creator />
      <dc:date>2015-06-30T07:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842349#M469584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice to know, that if costs are from one table I can write like this. But the point is that I want to use sum of costs in many places, so I don't want to write their sum all the time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 07:35:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842349#M469584</guid>
      <dc:creator />
      <dc:date>2015-06-30T07:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842350#M469585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for reply. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; Your answer is the best as for me - you've also showed me that I can use &lt;EM&gt;Alt&lt;/EM&gt; function to avoid errors (I think that this is for that ;p).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 07:42:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842350#M469585</guid>
      <dc:creator />
      <dc:date>2015-06-30T07:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842351#M469586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Monika, Alt() gives an alternative value when the first parameter is null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If one record has a value in Cost1 (let's say '10') but Cost2 is null, trying to do Cost1+Cost2 it does 10+null()=null(). Using Alt() the value of Cost2 is 0, so it does 10+0=10.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 10:01:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842351#M469586</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-06-30T10:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842352#M469587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I have such another problem. I have &lt;EM&gt;vCostAll&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({&amp;lt;[Some dimension]=&amp;gt;} Cost) * SUM( CostA ) / SUM( CostB )&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;And then I want use another filter on whole&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; vCostAll, &lt;/EM&gt;like this:&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;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;vFilteredCost: SUM({&amp;lt;[Some dimension 2]={'SomeOption'}&amp;gt;} $(&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;vCostAll)&lt;/EM&gt;)&lt;/EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;But it didn't works. Is there any way to overcome this except writing it all in one variable?&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, 03 Jul 2015 06:45:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842352#M469587</guid>
      <dc:creator />
      <dc:date>2015-07-03T06:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842353#M469588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see the same way for this, you need first each Sum() separatedly and then divide the result, so each Sum() has to have his set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe using variable parameters:&lt;/P&gt;&lt;P&gt;vCostAll: SUM({&amp;lt;&lt;STRONG&gt;$1&lt;/STRONG&gt;&amp;gt;} CostA ) / SUM({&amp;lt;&lt;STRONG&gt;$1&lt;/STRONG&gt;&amp;gt;} CostB )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:$(vCostAll(&lt;STRONG&gt;Dimension={'A'}&lt;/STRONG&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in there the comma separates parameters, if there will be more than one field in set analisys it can get complicated.&lt;/P&gt;&lt;P&gt;vCostAll: SUM({&amp;lt;$1,$2&amp;gt;} CostA ) / SUM({&amp;lt;$1,$2&amp;gt;} CostB )&lt;/P&gt;&lt;P&gt;Expression:$(vCostAll(Dimension1={'A'}, Dimension2={'B'}))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If any paremeter doesn't have value it still works, but if some field in set analysis needs more than one value I don't know how to do it in a simple expression, in example:&lt;/P&gt;&lt;P&gt;$(vCostAll(Dimension1={'A'}, Dimension2={'B', 'C'})) // The comma in Dimension2 values will be treated as variable parameter separator.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 10:52:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842353#M469588</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-07-06T10:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Variables with sum and filters</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842354#M469589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot! Your answer was very helpful form me. &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, 08 Jul 2015 07:52:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-sum-and-filters/m-p/842354#M469589</guid>
      <dc:creator />
      <dc:date>2015-07-08T07:52:04Z</dc:date>
    </item>
  </channel>
</rss>

