<?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, then and else formula with a sum in it in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959956#M13727</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reaction.&lt;/P&gt;&lt;P&gt;I'm gonna keep it in mind and try it the next time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Oct 2015 07:08:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-10-08T07:08:54Z</dc:date>
    <item>
      <title>If, then and else formula with a sum in it</title>
      <link>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959950#M13721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do I write the right formula for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If [Field B] =0&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;sum([Field C]*[Field D])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If [Field B] &amp;gt;=1&lt;/P&gt;&lt;P&gt;then &lt;/P&gt;&lt;P&gt;sum([Field B]*[Field C]*[Field D])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make an Master Item of it for a KPI diagram and I want the total sum in it.&lt;/P&gt;&lt;P&gt;In the example that would be € 4.312,60&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Field A&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Field B&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Field C&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Field D&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Sum&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;8&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;12&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;29,95&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2.875,20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;39,95&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;799,00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;8&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;19,95&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;638,40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Sum&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4.312,60&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want it to be looked at per line so I think that the 'sum' comes first and then the 'if' but I can not get a working formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried it both ways&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(if( [Field B] = 0, Then [Field C]*[Field D], Else[Field B]*[Field C]*[Field D]))&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;BR /&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;and&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;BR /&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;if [Field B] = 0, &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;Then sum([Field C]*[Field D]), &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;Else sum([Field B]*[Field C]*[Field D]))&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;End if&lt;BR /&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;BR /&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;and many versions of it, with and without commas or with or without spaces or with or without '= sign', or with and without enters, with capital letters, etc.&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;BR /&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;Is there anyone who can help me?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 13:38:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959950#M13721</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-29T13:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: If, then and else formula with a sum in it</title>
      <link>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959951#M13722</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;Try this:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If [Field B] =0,&amp;nbsp; [&lt;SPAN style="line-height: 1.5em;"&gt;Field C]*[Field D] , &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;If&amp;nbsp; ( [Field B] &amp;gt;=1 , &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;[Field B]*[Field C]*[Field D]) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 01:19:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959951#M13722</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-10-01T01:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: If, then and else formula with a sum in it</title>
      <link>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959952#M13723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Too bad, it's not working.&lt;/P&gt;&lt;P&gt;Do you write it on different lines or on 1 line?&lt;/P&gt;&lt;P&gt;And where do you have the spaces?&lt;/P&gt;&lt;P&gt;I now have it like this:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum&lt;SPAN style="line-height: 1.5em;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;If[Field B] =0, [&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; line-height: 1.5em; font-weight: inherit; font-style: inherit;"&gt;Field C]*[Field D],&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; line-height: 1.5em; font-weight: inherit; font-style: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; line-height: 1.5em; font-weight: inherit; font-style: inherit;"&gt;If( [Field B] &amp;gt;=1, &lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; line-height: 1.5em; font-weight: inherit; font-style: inherit;"&gt;[Field B]*[Field C]*[Field D])&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; font-style: inherit; font-weight: inherit; line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 07:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959952#M13723</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-01T07:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: If, then and else formula with a sum in it</title>
      <link>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959953#M13724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So sorry,&amp;nbsp; I forgot an opening parenthesis after the first if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum ( if (&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spaces and New lines are generally ok. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 13:11:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959953#M13724</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-10-01T13:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: If, then and else formula with a sum in it</title>
      <link>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959954#M13725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Louise,&lt;/P&gt;&lt;P&gt;It would be best for performance if you were to create a column in the data set that had what you needed.&amp;nbsp; Meaning, during the load script there would be a new column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;if( [Field B] = 0, &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Field C]*[Field D], &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Field B]*[Field C]*[Field D])&lt;/SPAN&gt; as &lt;SPAN style="font-size: 13.3333px;"&gt;[My KPI]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FROM ...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then your chart/KPI object becomes SUM([My KPI])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 16:29:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959954#M13725</guid>
      <dc:creator />
      <dc:date>2015-10-01T16:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: If, then and else formula with a sum in it</title>
      <link>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959955#M13726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, it's working now!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 07:07:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959955#M13726</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-08T07:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: If, then and else formula with a sum in it</title>
      <link>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959956#M13727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reaction.&lt;/P&gt;&lt;P&gt;I'm gonna keep it in mind and try it the next time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 07:08:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959956#M13727</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-08T07:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: If, then and else formula with a sum in it</title>
      <link>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959957#M13728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dag,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried it in another app and it's working perfectly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 07:37:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-then-and-else-formula-with-a-sum-in-it/m-p/959957#M13728</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-08T07:37:21Z</dc:date>
    </item>
  </channel>
</rss>

