<?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: Substraction script returns wrong values in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Substraction-script-returns-wrong-values/m-p/1901535#M10322</link>
    <description>&lt;P&gt;No idea what the actual underlying data is, so I couldn't begin to guess. I suggest breaking it down into two fields, one which returns Month and the other which returns lastmonth (but otherwise with the exact same formula), which should pinpoint where the issue is, and work from there.&lt;/P&gt;</description>
    <pubDate>Sat, 05 Mar 2022 18:22:14 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2022-03-05T18:22:14Z</dc:date>
    <item>
      <title>Substraction script returns wrong values</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Substraction-script-returns-wrong-values/m-p/1900596#M10300</link>
      <description>&lt;P&gt;My substraction returns the wrong values . First orderintake culumn shows a (correct) measure and the second shows the script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wrong substraction orderintake script.jpg" style="width: 559px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/73508i7A9B0B1A5D861639/image-size/large?v=v2&amp;amp;px=999" role="button" title="Wrong substraction orderintake script.jpg" alt="Wrong substraction orderintake script.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I use this script and tried al kinds of code to make it work, but it keeps returning the wrong values. Does anyone have an idea why this goes wrong?&lt;/P&gt;
&lt;P&gt;I use this script code:&lt;/P&gt;
&lt;P&gt;if(isnull([vorigemaandContractwaardemaandelijks]),[Contractwaardemaandelijks],[Contractwaardemaandelijks]-[vorigemaandContractwaardemaandelijks]) AS Orderintake_Period&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply put:&lt;/P&gt;
&lt;P&gt;if(isnull(LASTMONTH), MONTH, MONTH - LASTMONTH) AS Orderintake_Period&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 13:32:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Substraction-script-returns-wrong-values/m-p/1900596#M10300</guid>
      <dc:creator>JanArnold</dc:creator>
      <dc:date>2022-03-03T13:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Substraction script returns wrong values</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Substraction-script-returns-wrong-values/m-p/1900601#M10301</link>
      <description>&lt;P&gt;LastMonth looks to be zero, not null?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 13:38:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Substraction-script-returns-wrong-values/m-p/1900601#M10301</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-03-03T13:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Substraction script returns wrong values</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Substraction-script-returns-wrong-values/m-p/1900953#M10308</link>
      <description>&lt;P&gt;Correct, and then it should substract '&lt;SPAN&gt;MONTH - LASTMONTH'. It should return: -5696-0 = -5696. However it does return a 0. I'm clueless as to why.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 07:04:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Substraction-script-returns-wrong-values/m-p/1900953#M10308</guid>
      <dc:creator>JanArnold</dc:creator>
      <dc:date>2022-03-04T07:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Substraction script returns wrong values</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Substraction-script-returns-wrong-values/m-p/1901535#M10322</link>
      <description>&lt;P&gt;No idea what the actual underlying data is, so I couldn't begin to guess. I suggest breaking it down into two fields, one which returns Month and the other which returns lastmonth (but otherwise with the exact same formula), which should pinpoint where the issue is, and work from there.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2022 18:22:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Substraction-script-returns-wrong-values/m-p/1901535#M10322</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-03-05T18:22:14Z</dc:date>
    </item>
  </channel>
</rss>

