<?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: if else condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-else-condition/m-p/68945#M11344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are referencing the mat_con_qua field that is calculated in the same LOAD statement which will not work. I think you should replace the mat_con_qua with Sum(mat_con_qua) in your If() statement and see how that works for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2018 06:50:22 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2018-05-22T06:50:22Z</dc:date>
    <item>
      <title>if else condition</title>
      <link>https://community.qlik.com/t5/QlikView/if-else-condition/m-p/68944#M11343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(U_NL9s) as U_NL9s, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum([U-D_NL9s]) as [U-D_NL9s], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(D_NL9s) as D_NL9s, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Calendar_Month_Code, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Batch_Code, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(mat_con_qua) as mat_con_qua, &lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Country='Brazil' and Batch_Code='U',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sum(if(Strategic_Part='Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]&amp;lt;&amp;gt;0 and [U-D_NL9s]&amp;lt;&amp;gt;0.01, mat_con_qua))*-1)*(sum([U-D_NL9s])*1.055),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sum(if(Strategic_Part &amp;lt;&amp;gt;'Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]&amp;lt;&amp;gt;0 and [U-D_NL9s]&amp;lt;&amp;gt;0.01, mat_con_qua))*-1)*(sum([U-D_NL9s])*1.200)) as test&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;from [..\Consfiltered_NR.qvd]&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;(qvd)group by&amp;nbsp; Batch_Code, Country,Strategic_Part,Calendar_Month_Code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;My formula is working fine till &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt; if(Country='Brazil' and Batch_Code='U',&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sum(if(Strategic_Part='Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]&amp;lt;&amp;gt;0 and [U-D_NL9s]&amp;lt;&amp;gt;0.01, mat_con_qua))*-1)*(sum([U-D_NL9s])*1.055) &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;but else condition is not giving me correct value. i.e &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; (Sum(if(Strategic_Part &amp;lt;&amp;gt;'Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]&amp;lt;&amp;gt;0 and [U-D_NL9s]&amp;lt;&amp;gt;0.01, mat_con_qua))*-1)*(sum([U-D_NL9s])*1.200)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Can you please tell me where i am doing wrong.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Bharat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2018 06:16:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-else-condition/m-p/68944#M11343</guid>
      <dc:creator>bharatkishore</dc:creator>
      <dc:date>2018-05-22T06:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: if else condition</title>
      <link>https://community.qlik.com/t5/QlikView/if-else-condition/m-p/68945#M11344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are referencing the mat_con_qua field that is calculated in the same LOAD statement which will not work. I think you should replace the mat_con_qua with Sum(mat_con_qua) in your If() statement and see how that works for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2018 06:50:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-else-condition/m-p/68945#M11344</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-05-22T06:50:22Z</dc:date>
    </item>
  </channel>
</rss>

