<?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: Variable used in a definition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-used-in-a-definition/m-p/512024#M1146949</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're doing something like &lt;EM&gt;sum(sum(something)-sum(somethingelse))&lt;/EM&gt;. And that's not possible. You'll have to use the aggr function to aggregate the sums over some dimensions, &lt;EM&gt;sum(aggr(sum(something)-sum(somethingelse),DimensionP,DimensionQ)),&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;or rethink your expression altogether. Maybe just &lt;EM&gt;if(&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;[PrKg Act]-[PrKg Ant] &amp;gt; 0&lt;/SPAN&gt; , xxx, yyy )&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Jun 2013 13:22:23 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-06-26T13:22:23Z</dc:date>
    <item>
      <title>Variable used in a definition</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-used-in-a-definition/m-p/512023#M1146948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i am just learning how to create a dashboard etc.&lt;/P&gt;&lt;P&gt;I have two calculated fields:&lt;/P&gt;&lt;P&gt;Sum ([Sales value Act]) / Sum ([Weight Act]) which is called Pr/Kg Act&lt;/P&gt;&lt;P&gt;Sum ([Sales Value Ant]) / Sum ([Weight Ant]) which is called Pr/Kg Ant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now need to subtract Pr/Kg Ant from Pr/Kg Act to give me a total, which i will then use in the report with a predefined red arrow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created two variable for each of the calculations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PrKg Act &amp;amp; PrKg Ant, both use the calculations above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the definitions i have now put:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= if (sum ([PrKg Act]-[PrKg Ant]) &amp;gt; 0, 'qmem://&amp;lt;bundled&amp;gt;/BuiltIn/arrow_ne_g.png', 'qmem://&amp;lt;bundled&amp;gt;/BuiltIn/arrow_s_r.png')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result is everything is a red arrow, and it should not be!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on where i am going wrong. The expression is okay just not showing the right results..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for any help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 12:37:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-used-in-a-definition/m-p/512023#M1146948</guid>
      <dc:creator />
      <dc:date>2013-06-26T12:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Variable used in a definition</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-used-in-a-definition/m-p/512024#M1146949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're doing something like &lt;EM&gt;sum(sum(something)-sum(somethingelse))&lt;/EM&gt;. And that's not possible. You'll have to use the aggr function to aggregate the sums over some dimensions, &lt;EM&gt;sum(aggr(sum(something)-sum(somethingelse),DimensionP,DimensionQ)),&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;or rethink your expression altogether. Maybe just &lt;EM&gt;if(&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;[PrKg Act]-[PrKg Ant] &amp;gt; 0&lt;/SPAN&gt; , xxx, yyy )&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 13:22:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-used-in-a-definition/m-p/512024#M1146949</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-06-26T13:22:23Z</dc:date>
    </item>
  </channel>
</rss>

