<?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 Using variables in expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-variables-in-expressions/m-p/900087#M992712</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can anybody please help me?&lt;/P&gt;&lt;P&gt;Due to a system upgrade, I need to consolidate sales data from two sources, "Old Sales Data" and "New Sales Data".&lt;/P&gt;&lt;P&gt;Simply loading both as "Sales" in my load script causes problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a variable, $(Total Sales), being the sum of "Old Sales Data" plus the sum of "New Sales Data", which works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Sum (if (InMonth (Date, Today(), 0), [Old Sales Data]))&lt;/EM&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;EM&gt;Sum (if (InMonth (Date, Today(), 0), [New Sales Data]))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;also work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now want to use the same expression using my Total Sales variable, something like&amp;nbsp; &lt;STRONG style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;Sum (if (InMonth (Date, Today(), 0), $(Total Sales)))&lt;/EM&gt;&lt;/STRONG&gt;, but cannot get it to function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;Sum (if (InMonth (Date, Today(), 0), [Old Sales Data]))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;STRONG&gt;+&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;Sum (if (InMonth (Date, Today(), 0), [New Sales Data])) &lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;is the only way I have so far been able to return the value I require. This seems to be unnecessarily cumbersome. If I can use the variable then changing nearly a hundred expressions in my file can be simply achieved with the expressions editor, rather than a laborious longhand process.&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;EM&gt;Any help or suggestions on alternative management would be much appreciated.&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;EM&gt;Thank You.&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Jul 2015 07:11:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-07-18T07:11:30Z</dc:date>
    <item>
      <title>Using variables in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-in-expressions/m-p/900087#M992712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can anybody please help me?&lt;/P&gt;&lt;P&gt;Due to a system upgrade, I need to consolidate sales data from two sources, "Old Sales Data" and "New Sales Data".&lt;/P&gt;&lt;P&gt;Simply loading both as "Sales" in my load script causes problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a variable, $(Total Sales), being the sum of "Old Sales Data" plus the sum of "New Sales Data", which works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Sum (if (InMonth (Date, Today(), 0), [Old Sales Data]))&lt;/EM&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;EM&gt;Sum (if (InMonth (Date, Today(), 0), [New Sales Data]))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;also work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now want to use the same expression using my Total Sales variable, something like&amp;nbsp; &lt;STRONG style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;Sum (if (InMonth (Date, Today(), 0), $(Total Sales)))&lt;/EM&gt;&lt;/STRONG&gt;, but cannot get it to function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;Sum (if (InMonth (Date, Today(), 0), [Old Sales Data]))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;STRONG&gt;+&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;Sum (if (InMonth (Date, Today(), 0), [New Sales Data])) &lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;is the only way I have so far been able to return the value I require. This seems to be unnecessarily cumbersome. If I can use the variable then changing nearly a hundred expressions in my file can be simply achieved with the expressions editor, rather than a laborious longhand process.&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;EM&gt;Any help or suggestions on alternative management would be much appreciated.&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;EM&gt;Thank You.&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jul 2015 07:11:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-in-expressions/m-p/900087#M992712</guid>
      <dc:creator />
      <dc:date>2015-07-18T07:11:30Z</dc:date>
    </item>
  </channel>
</rss>

