<?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 statement issue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849944#M298161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if statement is working, but&lt;/P&gt;&lt;P&gt;OldBatteryPurchasePrice=' ', i could not figure out, if there is no value in the row, should i use double single quotes or???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 May 2015 12:19:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-05-26T12:19:40Z</dc:date>
    <item>
      <title>if statement issue</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849941#M298158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;im using qlikview 8.5 In the edit expression, I have added this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OldBatteryPurchasePrice &amp;gt;0, (((amt&amp;nbsp; + OldBatteryPurchasePrice)- Items_Dealerprice) / Items_Dealerprice ) * 100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and work prefectly, no issues............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I have some condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have few rows, where oldbatterypurchaseprice row does not contain value, for that, I have to use different formula to calculate the profit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;im trying the below if conditions, but it is not working... thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(&amp;nbsp; OldBatteryPurchasePrice &amp;gt;0, (((amt&amp;nbsp; + OldBatteryPurchasePrice)- Items_Dealerprice) / Items_Dealerprice ) * 100 )&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;If(OldBatteryPurchasePrice=' ', ((amt&amp;nbsp; - Items_Dealerprice) / Items_Dealerprice ) * 100 ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 11:46:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849941#M298158</guid>
      <dc:creator />
      <dc:date>2015-05-26T11:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: if statement issue</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849942#M298159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In general, you can check your second condition in the else-branch of the first if()-statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(&amp;nbsp; OldBatteryPurchasePrice &amp;gt;0,&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; (((amt&amp;nbsp; + OldBatteryPurchasePrice)- Items_Dealerprice) / Items_Dealerprice ) * 100&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(OldBatteryPurchasePrice=' ', ((amt&amp;nbsp; - Items_Dealerprice) / Items_Dealerprice ) * 100 )&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 11:57:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849942#M298159</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-05-26T11:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: if statement issue</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849943#M298160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope I have the gist of your issue.Not now familiar with v8.5, but on first sight I would say you are missing aggregation formula. Generally, but not always the aggregation should be outside the if statement so try;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum(If(&amp;nbsp; OldBatteryPurchasePrice &amp;gt;0, (((amt&amp;nbsp; + OldBatteryPurchasePrice)- Items_Dealerprice) / Items_Dealerprice ) * 100 )&lt;STRONG&gt;&lt;EM style="text-decoration: underline;"&gt;,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(OldBatteryPurchasePrice=' ', ((amt&amp;nbsp; - Items_Dealerprice) / Items_Dealerprice ) * 100 )&lt;STRONG&gt;&lt;EM style="text-decoration: underline;"&gt;))&lt;/EM&gt;&lt;/STRONG&gt;&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;Note I have changed your statement to a nested if;&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;if(a =1,3,if(a=4,7))&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;the whole statement has been enclosed with a sum(xxxxxx) statement &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;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 11:59:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849943#M298160</guid>
      <dc:creator>john_s_w_wood</dc:creator>
      <dc:date>2015-05-26T11:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: if statement issue</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849944#M298161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if statement is working, but&lt;/P&gt;&lt;P&gt;OldBatteryPurchasePrice=' ', i could not figure out, if there is no value in the row, should i use double single quotes or???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 12:19:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849944#M298161</guid>
      <dc:creator />
      <dc:date>2015-05-26T12:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: if statement issue</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849945#M298162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;len(trim(OldBatteryPurchasePrice)) = 0:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(&amp;nbsp; OldBatteryPurchasePrice &amp;gt;0,&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; (((amt&amp;nbsp; + OldBatteryPurchasePrice)- Items_Dealerprice) / Items_Dealerprice ) * 100&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If( len(trim(OldBatteryPurchasePrice))=0, ((amt&amp;nbsp; - Items_Dealerprice) / Items_Dealerprice ) * 100 )&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 12:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-issue/m-p/849945#M298162</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-05-26T12:24:00Z</dc:date>
    </item>
  </channel>
</rss>

