<?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 Create a new field with IF() function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-a-new-field-with-IF-function/m-p/149244#M27442</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John and Sachin for your hints.&lt;/P&gt;&lt;P&gt;I got rid of the problem when I reloaded all SQL-tables (and all fields) with LOAD RESIDENT command and then dropped the original tables. That is:&lt;/P&gt;&lt;P&gt;cbr_0:&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM (SQL database)&lt;/P&gt;&lt;P&gt;cbr_1:&lt;/P&gt;&lt;P&gt;LOAD *,IF(LC='Y' OR CC='Y' OR SC='Y','Yes','No') AS public_sector RESIDENT cbr_0&lt;/P&gt;&lt;P&gt;DROP TABLE cbr_0&lt;/P&gt;&lt;P&gt;Now I can manipulate all data with Qlikview functions without the limitations of the SQL-syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jul 2009 19:04:57 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-14T19:04:57Z</dc:date>
    <item>
      <title>Create a new field with IF() function</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-new-field-with-IF-function/m-p/149241#M27439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have loaded some data from a SQL server (see sample script below):&lt;/P&gt;&lt;P&gt;cbr_1:&lt;/P&gt;&lt;P&gt;SQL SELECT "local_council",&lt;BR /&gt;"county_council",&lt;BR /&gt;"state_council"&lt;BR /&gt;FROM "VPS_MD".dbo."cbr_1";&lt;/P&gt;&lt;P&gt;The fields are character flags with two possible values: (Y)es or (N)o&lt;BR /&gt;Now, I try to create another field - "public_sector" - and fill it in the following way:&lt;/P&gt;&lt;P&gt;LOAD IF([local_council]='Y' OR [County_council]='Y' OR [state_council]='Y','Yes','No') AS 'public_sector'&lt;BR /&gt;RESIDENT cbr_2 ;&lt;/P&gt;&lt;P&gt;In other words - if at least one of the the original flags are set to "Y", public_sector should be set to "Yes", otherwise "No".&lt;/P&gt;&lt;P&gt;When I run the script, the new field "public_sector" is created but values are always null, never "Yes" or "No".&lt;/P&gt;&lt;P&gt;I guess my ambitions are far greater than my skills in Qlikview... I hope someone can help me!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 05:45:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-new-field-with-IF-function/m-p/149241#M27439</guid>
      <dc:creator />
      <dc:date>2009-07-14T05:45:12Z</dc:date>
    </item>
    <item>
      <title>Create a new field with IF() function</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-new-field-with-IF-function/m-p/149242#M27440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, your resident table is cbr_1, not cbr_2. And public_sector shouldn't be in single quotes since it is a field name. But I'm guessing those were just typos when you wrote the post, and not the actual cause of the problem.&lt;/P&gt;&lt;P&gt;Other than that, I'm not seeing it. It reads fine to me. Sorry!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 06:16:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-new-field-with-IF-function/m-p/149242#M27440</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-07-14T06:16:32Z</dc:date>
    </item>
    <item>
      <title>Create a new field with IF() function</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-new-field-with-IF-function/m-p/149243#M27441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Table1:&lt;BR /&gt;&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; LC, CC, SC&lt;BR /&gt; 'N', 'N', 'Y'&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;LOAD IF(LC='Y' OR CC='Y' OR SC='Y','Yes','No') AS public_sector&lt;BR /&gt;RESIDENT Table1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 06:51:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-new-field-with-IF-function/m-p/149243#M27441</guid>
      <dc:creator />
      <dc:date>2009-07-14T06:51:36Z</dc:date>
    </item>
    <item>
      <title>Create a new field with IF() function</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-new-field-with-IF-function/m-p/149244#M27442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John and Sachin for your hints.&lt;/P&gt;&lt;P&gt;I got rid of the problem when I reloaded all SQL-tables (and all fields) with LOAD RESIDENT command and then dropped the original tables. That is:&lt;/P&gt;&lt;P&gt;cbr_0:&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM (SQL database)&lt;/P&gt;&lt;P&gt;cbr_1:&lt;/P&gt;&lt;P&gt;LOAD *,IF(LC='Y' OR CC='Y' OR SC='Y','Yes','No') AS public_sector RESIDENT cbr_0&lt;/P&gt;&lt;P&gt;DROP TABLE cbr_0&lt;/P&gt;&lt;P&gt;Now I can manipulate all data with Qlikview functions without the limitations of the SQL-syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 19:04:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-new-field-with-IF-function/m-p/149244#M27442</guid>
      <dc:creator />
      <dc:date>2009-07-14T19:04:57Z</dc:date>
    </item>
  </channel>
</rss>

