<?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: Expression - double if in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756034#M1025763</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sum(if(...)) is as far from best practice as you can come. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is much better to do in the script in my opinion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Unit = 'BOX', Quantity/1000,if( Type = '648',Quantity*-1,Quantity) as NewQuantity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from Fact....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the expression becomes Sum(NewQuantity)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Mar 2015 08:05:14 GMT</pubDate>
    <dc:creator>simenkg</dc:creator>
    <dc:date>2015-03-06T08:05:14Z</dc:date>
    <item>
      <title>Expression - double if</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756030#M1025759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've tried but haven't got the correct result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a quantity unit "BOX" where I need to divide my quantity with 1000 and it works if I use the following expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum&amp;nbsp;&amp;nbsp; (&amp;nbsp;&amp;nbsp; if (Unit = 'BOX' , Quantity/1000 , &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Quantity&lt;/SPAN&gt;)&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition I have two types of transactions, one is the cancellation so I would need to have this negativ. I use the following formula which works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum&amp;nbsp; (&amp;nbsp; if&amp;nbsp; (&amp;nbsp; Type = '648' , Quantity*-1 , &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Quantity)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I best combine them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 07:52:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756030#M1025759</guid>
      <dc:creator>sprqlikview</dc:creator>
      <dc:date>2015-03-06T07:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - double if</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756031#M1025760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;not sure I understood, but something like:&lt;/P&gt;&lt;P&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;sum&amp;nbsp;&amp;nbsp; (&amp;nbsp;&amp;nbsp; if (Unit = 'BOX' , Quantity/1000 , &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;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; if&amp;nbsp; (&amp;nbsp; Type = '648' , Quantity*-1 , &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Quantity) &lt;/SPAN&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;)&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is what you wish?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 07:55:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756031#M1025760</guid>
      <dc:creator>simospa</dc:creator>
      <dc:date>2015-03-06T07:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - double if</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756032#M1025761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum&amp;nbsp;&amp;nbsp; (&amp;nbsp;&amp;nbsp; if (Unit = 'BOX' , Quantity/1000 ,&lt;SPAN style="line-height: 1.5em;"&gt;if&amp;nbsp; (&amp;nbsp; Type = '648' , Quantity*-1 , &lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; line-height: 1.5em; font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px;"&gt;Quantity)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 07:56:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756032#M1025761</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2015-03-06T07:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - double if</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756033#M1025762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that. The else statement confused me and I've tried something far to complicated. Appreciate the quick response.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 08:00:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756033#M1025762</guid>
      <dc:creator>sprqlikview</dc:creator>
      <dc:date>2015-03-06T08:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - double if</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756034#M1025763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sum(if(...)) is as far from best practice as you can come. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is much better to do in the script in my opinion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Unit = 'BOX', Quantity/1000,if( Type = '648',Quantity*-1,Quantity) as NewQuantity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from Fact....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the expression becomes Sum(NewQuantity)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 08:05:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756034#M1025763</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2015-03-06T08:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Expression - double if</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756035#M1025764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have solved it like this now. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 12:23:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-double-if/m-p/756035#M1025764</guid>
      <dc:creator>sprqlikview</dc:creator>
      <dc:date>2015-03-06T12:23:02Z</dc:date>
    </item>
  </channel>
</rss>

