<?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 Nested if statements in load script, how to combine them into one field? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-if-statements-in-load-script-how-to-combine-them-into-one/m-p/1826030#M1213978</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I have a table with fields such as Value, Balance, and Quantity, they are all numbers or strings of numbers. I want to achieve the following result inside load script:&lt;/P&gt;&lt;P&gt;if Value is less than zero and if Balance is not null, use Quantity as Deleted, otherwise if Value is less than zero and if Balance is null, use Balance instead as Deleted. So I would want one Deleted field as a result. I think this should be easy to do but I can't get this to work, here's what I'm trying to do but it doesnt work:&lt;/P&gt;&lt;P&gt;if (Value &amp;lt; 0,&lt;BR /&gt;if (IsNull(Balance),&lt;BR /&gt;Quantity)) as Deleted,&lt;BR /&gt;if (Value &amp;lt; 0,&lt;BR /&gt;if (not IsNull(Balance),&lt;BR /&gt;num(Balance) as Deleted&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 02 Aug 2021 09:38:48 GMT</pubDate>
    <dc:creator>pgkrsk</dc:creator>
    <dc:date>2021-08-02T09:38:48Z</dc:date>
    <item>
      <title>Nested if statements in load script, how to combine them into one field?</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-statements-in-load-script-how-to-combine-them-into-one/m-p/1826030#M1213978</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I have a table with fields such as Value, Balance, and Quantity, they are all numbers or strings of numbers. I want to achieve the following result inside load script:&lt;/P&gt;&lt;P&gt;if Value is less than zero and if Balance is not null, use Quantity as Deleted, otherwise if Value is less than zero and if Balance is null, use Balance instead as Deleted. So I would want one Deleted field as a result. I think this should be easy to do but I can't get this to work, here's what I'm trying to do but it doesnt work:&lt;/P&gt;&lt;P&gt;if (Value &amp;lt; 0,&lt;BR /&gt;if (IsNull(Balance),&lt;BR /&gt;Quantity)) as Deleted,&lt;BR /&gt;if (Value &amp;lt; 0,&lt;BR /&gt;if (not IsNull(Balance),&lt;BR /&gt;num(Balance) as Deleted&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 09:38:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-statements-in-load-script-how-to-combine-them-into-one/m-p/1826030#M1213978</guid>
      <dc:creator>pgkrsk</dc:creator>
      <dc:date>2021-08-02T09:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if statements in load script, how to combine them into one field?</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-statements-in-load-script-how-to-combine-them-into-one/m-p/1826031#M1213979</link>
      <description>&lt;P&gt;It looks like you're trying to create two fields rather than one...&lt;/P&gt;&lt;P&gt;I've gone with a NOT approach to match your order but you could just as easily write it with the THEN and ELSE reversed and remove the NOT.&lt;/P&gt;&lt;P&gt;If(Value&amp;lt;0,if(not isnull(Balance),Quantity,Balance)) as Deleted&lt;/P&gt;&lt;P&gt;Note that this will return null if Value is 0 or greater since you haven't provided any outcomes for that.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 10:11:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-statements-in-load-script-how-to-combine-them-into-one/m-p/1826031#M1213979</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-08-02T10:11:18Z</dc:date>
    </item>
  </channel>
</rss>

