<?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 multiplying variable by -1 is causing an issue? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/multiplying-variable-by-1-is-causing-an-issue/m-p/268287#M1188661</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it a copy and paste error that you refer to $(Current) instead of $(vCurrent) in the then-section?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Sep 2011 15:51:47 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-09-16T15:51:47Z</dc:date>
    <item>
      <title>multiplying variable by -1 is causing an issue?</title>
      <link>https://community.qlik.com/t5/QlikView/multiplying-variable-by-1-is-causing-an-issue/m-p/268286#M1188660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone tell me why this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;=if(num(Left(glaccount,1))&amp;gt;=4,($(Sales)-$(COGS)-$(NetIncome)) ,&lt;/P&gt;&lt;P&gt;if( left(glaccount,1)='1', &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;($(Current)*(-1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; +&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(vPrior)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;($(vCurrent)*(-1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;($(vPrior) *(-1))&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Returns a null result, yet this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;=if(num(Left(glaccount,1))&amp;gt;=4,($(Sales)-$(COGS)-$(NetIncome)) ,&lt;/P&gt;&lt;P&gt;if( left(glaccount,1)='1', &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(Current)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; +&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(vPrior)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(vCurrent)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;($(vPrior) *(-1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Returns a result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need $(vCurrent) to be negative in this expression, but multiplying by -1 is causing an issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;This is the formula that is written to the variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;(sum({$&amp;lt; [Fiscal Period] = {"&amp;lt;=$(=Max([Fiscal Period]))"}&amp;gt;} if([Category Description]&amp;lt;&amp;gt;'Cash &amp;amp; Equivalents',(if( [Fiscal Period]=0&amp;nbsp; , 0 ,&amp;nbsp; creditamt+debitamt)&amp;nbsp; + openbalance))))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried adding the *-1 to this variable, but the expression seems to ignore it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prior=&amp;nbsp;&amp;nbsp; -137,084&lt;/P&gt;&lt;P&gt;Current=&amp;nbsp;&amp;nbsp; -138,833&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need &lt;/P&gt;&lt;P&gt;vCurrent *-1 + vPrior&lt;/P&gt;&lt;P&gt;138,833+(-137,084) to return the result of 1,749&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but my result seems to be stuck at -137,084 no matter what I do to vCurrent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2011 14:35:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/multiplying-variable-by-1-is-causing-an-issue/m-p/268286#M1188660</guid>
      <dc:creator />
      <dc:date>2011-09-16T14:35:30Z</dc:date>
    </item>
    <item>
      <title>multiplying variable by -1 is causing an issue?</title>
      <link>https://community.qlik.com/t5/QlikView/multiplying-variable-by-1-is-causing-an-issue/m-p/268287#M1188661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it a copy and paste error that you refer to $(Current) instead of $(vCurrent) in the then-section?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2011 15:51:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/multiplying-variable-by-1-is-causing-an-issue/m-p/268287#M1188661</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-16T15:51:47Z</dc:date>
    </item>
    <item>
      <title>multiplying variable by -1 is causing an issue?</title>
      <link>https://community.qlik.com/t5/QlikView/multiplying-variable-by-1-is-causing-an-issue/m-p/268288#M1188662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I feel like an idiot now...Indeed that was the problem. Waste of a couple hours of searching for the problem. Works great now, Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2011 15:54:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/multiplying-variable-by-1-is-causing-an-issue/m-p/268288#M1188662</guid>
      <dc:creator />
      <dc:date>2011-09-16T15:54:12Z</dc:date>
    </item>
  </channel>
</rss>

