<?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</title>
    <link>https://community.qlik.com/t5/QlikView/If-Statement/m-p/414114#M154053</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Julia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The line where you create the Country (Land?) field is not an aggregated (eg SUM) or single (eg MAX) value, so that column needs to be included in the group by clause.&amp;nbsp; Alternatively you can move the creation of that field into the preceding LOAD portion (eg LOAD*, if(country_id='1' ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Feb 2013 12:35:59 GMT</pubDate>
    <dc:creator>flipside</dc:creator>
    <dc:date>2013-02-07T12:35:59Z</dc:date>
    <item>
      <title>If Statement</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement/m-p/414113#M154052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question works if I comment "if(c.country_id='1', 'SE', 'annat_land') as Land,"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Buyers:&lt;/P&gt;&lt;P&gt;LOAD * ;&lt;/P&gt;&lt;P&gt;SQL select cu.email as [Email Address], &lt;/P&gt;&lt;P&gt;max(o.created_at) as last_order_date, &lt;/P&gt;&lt;P&gt;cu.identity_number,&lt;/P&gt;&lt;P&gt;if(c.country_id='1', 'SE', 'other') as Country,&lt;/P&gt;&lt;P&gt;c.country_id&lt;/P&gt;&lt;P&gt;from carts c&lt;/P&gt;&lt;P&gt;left join customers cu on c.customer_id=cu.id&lt;/P&gt;&lt;P&gt;left join orders o on o.cart_id=c.id&lt;/P&gt;&lt;P&gt;where o.created_at&amp;gt;'2010-01-01 00:00:00.000'&lt;/P&gt;&lt;P&gt;and o.order_status_id&amp;gt;'100'&lt;/P&gt;&lt;P&gt;group by cu.email,cu.identity_number,c.country_id;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Julia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 12:27:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement/m-p/414113#M154052</guid>
      <dc:creator />
      <dc:date>2013-02-07T12:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement/m-p/414114#M154053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Julia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The line where you create the Country (Land?) field is not an aggregated (eg SUM) or single (eg MAX) value, so that column needs to be included in the group by clause.&amp;nbsp; Alternatively you can move the creation of that field into the preceding LOAD portion (eg LOAD*, if(country_id='1' ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 12:35:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement/m-p/414114#M154053</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2013-02-07T12:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement/m-p/414115#M154054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Julia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you try this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;if(c.country_id=1, 'SE', 'annat_land') as Land,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;I removed quotes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Hope that helps you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 12:36:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement/m-p/414115#M154054</guid>
      <dc:creator>martin59</dc:creator>
      <dc:date>2013-02-07T12:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement/m-p/414116#M154055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 13:10:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement/m-p/414116#M154055</guid>
      <dc:creator />
      <dc:date>2013-02-07T13:10:34Z</dc:date>
    </item>
  </channel>
</rss>

