<?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 in qlikview expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639796#M476336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if(sum({$&amp;lt;StoreID={'1','16','19'}&amp;gt;}sale),sum(sale),sum(sale/rate))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jun 2014 20:14:42 GMT</pubDate>
    <dc:creator>venkatg6759</dc:creator>
    <dc:date>2014-06-04T20:14:42Z</dc:date>
    <item>
      <title>if statement in qlikview expressions</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639795#M476335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am creating an analysis dashboard. Since the currency rate does not include 1 for US Dollars, I need to write an If statement for the sales in US$ across the stores around the world. Since store ID 1,16, 19 are all using US dollars, the expression I wrote is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If (StoreID=1 or 16 or 19, sum(sale), sum(sale/rate)).&amp;nbsp; But when I double check, say Japanese store, the result returned to me is still sum(sale) instead of sum(sale/rate). Can someone tell me what goes wrong here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gloria&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 20:03:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639795#M476335</guid>
      <dc:creator />
      <dc:date>2014-06-04T20:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in qlikview expressions</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639796#M476336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if(sum({$&amp;lt;StoreID={'1','16','19'}&amp;gt;}sale),sum(sale),sum(sale/rate))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 20:14:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639796#M476336</guid>
      <dc:creator>venkatg6759</dc:creator>
      <dc:date>2014-06-04T20:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in qlikview expressions</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639797#M476337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your condition is always true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&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;"&gt;If (StoreID=1 or StoreID = 16 or StoreID =19, sum(sale), sum(sale/rate))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&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;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&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;"&gt;If (match(StoreID,1,16,19), sum(sale), sum(sale/rate))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 20:22:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639797#M476337</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2014-06-04T20:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in qlikview expressions</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639798#M476338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or you could convert the Sale values in your script instead, and just do a sum(Sale) in your chart expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If doing it in script, either one of swuehl's expression will work and you would just alias it &lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;as&lt;/STRONG&gt;&lt;/SPAN&gt; Sale.&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 Jun 2014 00:29:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639798#M476338</guid>
      <dc:creator>shawn-qv</dc:creator>
      <dc:date>2014-06-06T00:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in qlikview expressions</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639799#M476339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Converting in script itself is a good idea, because if you are doing this in expression then you have to write if in all the set analysis expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this in script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;If(Match(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;StoreID, 1, 16, 19), &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sale&lt;/SPAN&gt;, sale/rate) AS SalesValue&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;FROM Datasource;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in set analysis just use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;SalesValue&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to handle this in script then use this expression&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;"&gt;If (Match(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;StoreID, 1, 16, 19)&lt;/SPAN&gt;, sum(sale), sum(sale/rate))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&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;"&gt;OR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;StoreID*={1, 16, 19}&lt;/SPAN&gt;&amp;gt;}sale) + &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Sum({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;StoreID-={1, 16, 19}&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;gt;}sale/rate)&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;"&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;"&gt;Hope this helps you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&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;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 01:56:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-in-qlikview-expressions/m-p/639799#M476339</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-06-06T01:56:08Z</dc:date>
    </item>
  </channel>
</rss>

