<?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: Subtraction of two SET Variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403440#M803896</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;Please find the my expression below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="value.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/183517_value.PNG" style="height: 71px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Nov 2017 13:13:45 GMT</pubDate>
    <dc:creator>kvr9</dc:creator>
    <dc:date>2017-11-16T13:13:45Z</dc:date>
    <item>
      <title>Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403431#M803887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm stuck with an issue with subtraction. My data contain two variables was trying to subtract them but it is not working properly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set vCountry=1,&lt;/P&gt;&lt;P&gt;Set vValue =if(vCountry =1,Localcurrency, Localcurrency*exchangerate)&lt;/P&gt;&lt;P&gt;Set vSale =if(vCountry=1,Sales,Sales*exchangerate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;above is the variables I have created for my data and was trying to subtract them as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vValue -vSale &lt;/P&gt;&lt;P&gt;I am getting result for local values but not the converted values i.e if country is 0 or more than 1 then it should convert using exchange rates but it is not working as expected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some one help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403431#M803887</guid>
      <dc:creator>kvr9</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403432#M803888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try with parenthesis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #ff0000; font-size: 14pt;"&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;vValue&lt;SPAN style="color: #ff0000; font-size: 14pt;"&gt;)&lt;/SPAN&gt; - &lt;STRONG style=": ; color: #ff0000; font-size: 14pt;"&gt;(&lt;/STRONG&gt;vSale&lt;STRONG style=": ; color: #ff0000; font-size: 14pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;)&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 12:33:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403432#M803888</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-11-16T12:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403433#M803889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry missed to mention.I used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(vValue) -sum(vSale) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more point the code is working when I use the expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;if(vCountry =1,Localcurrency, Localcurrency*exchangerate)) - sum(&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(vCountry=1,Sales,Sales*exchangerate)&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; )&lt;/P&gt;&lt;P&gt;instead of variable that where I'm confused should I use any function before this variables to make the subtraction to work??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 12:38:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403433#M803889</guid>
      <dc:creator>kvr9</dc:creator>
      <dc:date>2017-11-16T12:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403434#M803890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using an equal sign when you store this in the variable? May be remove the equal sign from the expression and then check&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 12:40:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403434#M803890</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-11-16T12:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403435#M803891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Instead of SET use LET to store value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 12:42:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403435#M803891</guid>
      <dc:creator>sumanta12</dc:creator>
      <dc:date>2017-11-16T12:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403436#M803892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;I defined as mentioned above,can you please tell me if any thing wrong in above&amp;nbsp; statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 12:49:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403436#M803892</guid>
      <dc:creator>kvr9</dc:creator>
      <dc:date>2017-11-16T12:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403437#M803893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 14pt;"&gt;&lt;STRONG&gt;$(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;vValue&lt;SPAN style="color: #ff0000; font-size: 14pt;"&gt;)&lt;/SPAN&gt; - &lt;SPAN style="color: #ff0000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 14pt;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;vSale&lt;SPAN style="color: #ff0000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 14pt;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG style="color: #ff0000; font-size: 14pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt;"&gt;in text box,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt;"&gt;where as in expression,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 14pt;"&gt;&lt;STRONG style=": ; color: #000000; font-size: 10pt;"&gt;Sum($(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;vValue) )- Sum($&lt;STRONG&gt;(&lt;/STRONG&gt;vSale&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG style=": ; color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG style=": ; color: #000000;"&gt;))&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG style=": ; color: #000000; font-size: 14pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG style=": ; color: #000000; font-size: 14pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 12:50:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403437#M803893</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2017-11-16T12:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403438#M803894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sumanth,&lt;/P&gt;&lt;P&gt;Since I used set to store the variable I prefixed it with $ while using in expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 12:50:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403438#M803894</guid>
      <dc:creator>kvr9</dc:creator>
      <dc:date>2017-11-16T12:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403439#M803895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The variables seem ok, but AFAIK the way you try to use their content is wrong. You don't want to use a LET statement or preliminary variable evaluation by prefixing the string in each with an equal sign. Both lead to either errors or nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You want simple text substitution so that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Sum(Variable)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;leads to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Sum(ExpressionInsideVariable)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before the Sum() is calculated. Please try with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=Sum($(vValue)) - Sum($(vSales))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 12:56:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403439#M803895</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-11-16T12:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403440#M803896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;Please find the my expression below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="value.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/183517_value.PNG" style="height: 71px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 13:13:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403440#M803896</guid>
      <dc:creator>kvr9</dc:creator>
      <dc:date>2017-11-16T13:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403441#M803897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you saying that you have a problem with putting this expression in the variable so that the intended $-sign substitutions survive the execution of your script ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mind you, if this was the expression all along, then please post it at once. Your simplified example doesn't contain any $-sign substitutions at all, thereby possibly eliminating the issue you are facing...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 13:44:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403441#M803897</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-11-16T13:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403442#M803898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please post the actual SET statements of the variables you use in an object to assemble the expression. Ok, they may not be working now, but what do they look like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 13:46:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403442#M803898</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-11-16T13:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403443#M803899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;Please find the set variables statements.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="vartest.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/183632_vartest.PNG" style="height: 52px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2017 06:35:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403443#M803899</guid>
      <dc:creator>kvr9</dc:creator>
      <dc:date>2017-11-17T06:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403444#M803900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, let's continue with a picture of the SET statements. Next time please post them as text so that we can reuse them in our own tests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you realize that if you say for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=Sum($(vValueField))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in an object expression, that you will be trying to calculate a sum() of &lt;EM&gt;a series of strings&lt;/EM&gt;?&lt;/P&gt;&lt;P&gt;Quoted items are recognized as string constants and not as the fields they represent. Why do you quote your field names?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also be aware that your expressions carry an initial equal sign. That means that in the expression I mentioned above, not the content of the variable will be used, but the result of evaluation of the content. Since $-sign substitution in object expressions is performed &lt;EM&gt;before the object is recalculated&lt;/EM&gt;, you will not get a single row-dependent value but all field values in each IF(). Which commonly evaluates as NULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So try to remove the quotes and the equal signs in front of the SET expressions and try again with $-sign substitution in your expressions, instead of fully specifying them in each object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the &lt;SPAN style="font-family: 'courier new', courier;"&gt;vNumberFormat&lt;/SPAN&gt; variable you did the inverse with respect to quotes and strings, and it may work but that depends on whether &lt;SPAN style="font-family: 'courier new', courier;"&gt;DivisionFormat&lt;/SPAN&gt; is a field (or a variable) with a single value or with multiple values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2017 08:37:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403444#M803900</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-11-17T08:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403445#M803901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apologies for sharing the expression in picture format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the expressions :&lt;/P&gt;&lt;P&gt;I am trying to use the below expression but it is not working as expected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=num(SUM({&amp;lt;Year={$(=max(Year))},[Payment Type]={'R&amp;amp;D'}&amp;gt;}$(vDvalueField)/UnitDivision)-sum({&amp;lt;Year={$(=max(Year))},[Payment Type]={'R&amp;amp;D'}&amp;gt;}$(vValueField)/UnitDivision),'$(vNumberFormat)')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So replaced the varaiables with expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=num(SUM({&amp;lt;Year={$(=max(Year))},[Payment Type]={'R&amp;amp;D'}&amp;gt;}if($(vLocalValue) =1,(DisclosedToV*ExchangeRateToUSD), DisclosedToV)/UnitDivision)-sum({&amp;lt;Year={$(=max(Year))},[Payment Type]={'R&amp;amp;D'}&amp;gt;} if($(vLocalValue) =1, SpendAmount, (SpendAmount/ExchangeRateToUSD))/UnitDivision),'$(vNumberFormat)')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issues is at conversion i.e the IF condition is not calculating as expected when we use a varaiable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the set expressions:&lt;/P&gt;&lt;P&gt;Set vLocalValue = 0;&lt;/P&gt;&lt;P&gt;Set vValueField = =if(vLocalValue=1, '[SpendAmount]', '[SpendAmount]/[ExchangeRateToUSD]');&lt;/P&gt;&lt;P&gt;Set vDisclosedToV = =if(vLocalValue=1,'[DisclosedToV]*[ExchangeRateToUSD]', '[DisclosedToV]');&lt;/P&gt;&lt;P&gt;Set vNumberFormat = =if(vLocalValue=0, DivisionFormat, Replace(DivisionFormat,'$',''));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was unable to get your point,request you to share the test qvw file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 06:25:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403445#M803901</guid>
      <dc:creator>kvr9</dc:creator>
      <dc:date>2017-11-20T06:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403446#M803902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the individual variables are working as expected &lt;/P&gt;&lt;P&gt;=num(sum({&amp;lt;Year={$(=max(Year))}&amp;gt;}$(vDisclosedToV)/UnitDivision),'$(vNumberFormat)')&lt;/P&gt;&lt;P&gt;=num(sum({&amp;lt;Year={$(=max(Year))}&amp;gt;} $(vValueField)/UnitDivision),'$(vNumberFormat)')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but while I'm trying to&amp;nbsp; subtract it is not working(calculating) for conversions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 06:28:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403446#M803902</guid>
      <dc:creator>kvr9</dc:creator>
      <dc:date>2017-11-20T06:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403447#M803907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Image please? I would expect 3 images which are 2 images for different variables in diff. formats and then show us with Subtract data with formulae too&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 06:31:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403447#M803907</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-20T06:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403448#M803908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 1st image is for two expressions one of the expression is commented.&lt;/P&gt;&lt;P&gt;1st expression=num(SUM({&amp;lt;Year={$(=max(Year))},[Payment Type]={'R&amp;amp;D'}&amp;gt;}$(vDvalueField)/UnitDivision)-sum({&amp;lt;Year={$(=max(Year))},[Payment Type]={'R&amp;amp;D'}&amp;gt;}$(vValueField)/UnitDivision),'$(vNumberFormat)')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2nd expression&lt;/P&gt;&lt;P&gt;=num(SUM({&amp;lt;Year={$(=max(Year))},[Payment Type]={'R&amp;amp;D'}&amp;gt;}if($(vLocalValue) =1,(DisclosedToV*ExchangeRateToUSD), DisclosedToV)/UnitDivision)-sum({&amp;lt;Year={$(=max(Year))},[Payment Type]={'R&amp;amp;D'}&amp;gt;} if($(vLocalValue) =1, SpendAmount, (SpendAmount/ExchangeRateToUSD))/UnitDivision),'$(vNumberFormat)')&lt;/P&gt;&lt;P&gt;&lt;IMG alt="value.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/183842_value.PNG" style="height: 71px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;2nd is for Set variables&lt;IMG alt="vartest.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/183843_vartest.PNG" style="height: 52px; width: 620px;" /&gt; &lt;/P&gt;&lt;P&gt;Please find the set expressions:&lt;/P&gt;&lt;P&gt;Set vLocalValue = 0;&lt;/P&gt;&lt;P&gt;Set vValueField = =if(vLocalValue=1, '[SpendAmount]', '[SpendAmount]/[ExchangeRateToUSD]');&lt;/P&gt;&lt;P&gt;Set vDisclosedToV = =if(vLocalValue=1,'[DisclosedToV]*[ExchangeRateToUSD]', '[DisclosedToV]');&lt;/P&gt;&lt;P&gt;Set vNumberFormat = =if(vLocalValue=0, DivisionFormat, Replace(DivisionFormat,'$',''));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 06:38:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403448#M803908</guid>
      <dc:creator>kvr9</dc:creator>
      <dc:date>2017-11-20T06:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403449#M803909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was asking earlier about your result due to this?&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;the individual variables are working as expected &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;=num(sum({&amp;lt;Year={$(=max(Year))}&amp;gt;}$(vDisclosedToV)/UnitDivision),'$(vNumberFormat)')&lt;/P&gt;
&lt;P&gt;=num(sum({&amp;lt;Year={$(=max(Year))}&amp;gt;} $(vValueField)/UnitDivision),'$(vNumberFormat)')&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;but while I'm trying to&amp;nbsp; subtract it is not working(calculating) for conversions&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 07:11:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403449#M803909</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-20T07:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of two SET Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403450#M803910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil,&lt;/P&gt;&lt;P&gt;if I use the expression 2 i.e complete if condition instead of variable then the calculation is fine when I select USD and EUR.&lt;BR /&gt;&lt;IMG alt="usd.PNG" class="jive-image image-1" height="735" src="https://community.qlik.com/legacyfs/online/183859_usd.PNG" style="height: 734.984px; width: 1633px; float: none;" width="1633" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;If we use the expression 1 i.e variable the the result is&lt;IMG alt="USD Ipng.png" class="jive-image image-3" src="/legacyfs/online/183878_USD Ipng.png" /&gt;i.e the subtraction is taking the value before conversions and appending the $&lt;/SPAN&gt;&lt;IMG alt="eur21.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/183872_eur21.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 09:49:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtraction-of-two-SET-Variables/m-p/1403450#M803910</guid>
      <dc:creator>kvr9</dc:creator>
      <dc:date>2017-11-20T09:49:20Z</dc:date>
    </item>
  </channel>
</rss>

