<?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: Inserting field with an if statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574812#M679894</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I fixed the code to look like that, but for some reason I am still getting a syntax error. Should I be putting this at the bottom of the script or inside of the SQL SELECT statements?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Apr 2014 15:34:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-04-14T15:34:32Z</dc:date>
    <item>
      <title>Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574809#M679891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have imported a few SQL database tables into my qlikview worksheet, but I am interested in creating a new field on this import and can't seem to get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what the non-working code looks like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TableName:&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;"Field1",&lt;/P&gt;&lt;P&gt;"Field2",&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; if(Field1 &amp;lt; 30, 'current'),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if(Field1 &amp;gt; 29 AND Field 1 &amp;lt;60, '30-59'),&lt;/P&gt;&lt;P&gt;if(Field1 &amp;gt; 59 AND Field1 &amp;lt; 90, '60-89'),&lt;/P&gt;&lt;P&gt;if(Field1 &amp;gt; 89 AND Field1 &amp;lt;120, '90-119'),&lt;/P&gt;&lt;P&gt;if(Field1 &amp;gt; 119, '120+') as [Description]&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;FROM SQL table name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If you can't tell from the code I am trying to use logic based on field1 to insert specific strings into a new field called Description. Does anyone know what I am doing wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thank you&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 15:22:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574809#M679891</guid>
      <dc:creator />
      <dc:date>2014-04-14T15:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574810#M679892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;if(Field1 &amp;lt; 30, 'current',&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 29 AND Field 1 &amp;lt;60, '30-59',&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 59 AND Field1 &amp;lt; 90, '60-89',&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 89 AND Field1 &amp;lt;120, '90-119',&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 119, '120+'))))) as [Description]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 15:24:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574810#M679892</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-14T15:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574811#M679893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quite good, just balance parenthesis:&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;if(Field1 &amp;lt; 30, 'current',&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 29 AND Field 1 &amp;lt;60, '30-59',&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 59 AND Field1 &amp;lt; 90, '60-89',&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 89 AND Field1 &amp;lt;120, '90-119',&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 119, '120+', 'N.A.')&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;))))&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;as [Description]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 15:25:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574811#M679893</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2014-04-14T15:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574812#M679894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I fixed the code to look like that, but for some reason I am still getting a syntax error. Should I be putting this at the bottom of the script or inside of the SQL SELECT statements?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 15:34:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574812#M679894</guid>
      <dc:creator />
      <dc:date>2014-04-14T15:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574813#M679895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SELECT&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;"Field1",&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;"Field2",&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;if(Field1 &amp;lt; 30, 'current',&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;if(Field1 &amp;gt; 29 AND Field 1 &amp;lt;60, '30-59',&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;if(Field1 &amp;gt; 59 AND Field1 &amp;lt; 90, '60-89',&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;if(Field1 &amp;gt; 89 AND Field1 &amp;lt;120, '90-119',&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;if(Field1 &amp;gt; 119, '120+', 'N.A.')&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;))))&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;as [Description]&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;From ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 15:39:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574813#M679895</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2014-04-14T15:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574814#M679896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have some space between Field 1... make sure that Field1 and Field 1 are different in qlikview..&lt;/P&gt;&lt;P&gt;use below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Field1 &amp;lt; 30, 'Current',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Field1 &amp;gt; 29 AND Field1 &amp;lt;60, '30-59',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Field1 &amp;gt; 59 AND Field1 &amp;lt; 90, '60-89',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Field1 &amp;gt; 89 AND Field1 &amp;lt;120, '90-119',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Field1 &amp;gt; 119, '120+'))))) as [Description]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;[Field 1] instead of Field1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 15:44:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574814#M679896</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-14T15:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574815#M679897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have that exact code in my script but am still getting a syntax error. I'm going to play around with it to see if I can get it to work, but do you have any idea why this isn't working?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 15:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574815#M679897</guid>
      <dc:creator />
      <dc:date>2014-04-14T15:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574816#M679898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No Matthew, parenthesis were unbalanced, read better and look at the position of ) inside the script ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 16:02:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574816#M679898</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2014-04-14T16:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574817#M679899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there try below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;if(Field1 &amp;lt; 30, 'current',&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 29 AND Field 1 &amp;lt;60, '30-59',&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 59 AND Field1 &amp;lt; 90, '60-89',&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 89 AND Field1 &amp;lt;120, '90-119',&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 119, '120+', 'N.A.')&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;))))&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;as [Description];&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL SELECT *&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;FROM SQL table name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&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 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&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 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 17:33:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574817#M679899</guid>
      <dc:creator>preminqlik</dc:creator>
      <dc:date>2014-04-14T17:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574818#M679900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another thought...have you looked into the class() function?&lt;/P&gt;&lt;P&gt;~Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 17:42:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574818#M679900</guid>
      <dc:creator>Greg_Williams</dc:creator>
      <dc:date>2014-04-14T17:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574819#M679901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; Hi Mathew,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit; line-height: 1.5em;"&gt;you can also use like this&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;TableName:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL SELECT&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;*&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit;"&gt;FROM SQL table name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit;"&gt;Final:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit; line-height: 1.5em;"&gt;load&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;"Field1",&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;"Field2",&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;if(Field1 &amp;lt; 30, 'current'),&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 29 AND Field 1 &amp;lt;60, '30-59'),&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 59 AND Field1 &amp;lt; 90, '60-89'),&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 89 AND Field1 &amp;lt;120, '90-119'),&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Field1 &amp;gt; 119, '120+') as [Description]&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;TableName&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;drop table &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;TableName&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Regards&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Deepak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 17:52:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574819#M679901</guid>
      <dc:creator />
      <dc:date>2014-04-14T17:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting field with an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574820#M679902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think after SQL SELECT &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;you can use the syntax of the database, not the syntax of qlikview&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;does your database support if .... ?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want to use Qlikview syntax use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;// start Qlik&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if................ as ........&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;// end Qlik&lt;/P&gt;&lt;P&gt;// start db&lt;/P&gt;&lt;P&gt;SQL &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL SELECT&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Field1",&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Field2"&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM SQL table name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 18:28:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inserting-field-with-an-if-statement/m-p/574820#M679902</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-04-14T18:28:32Z</dc:date>
    </item>
  </channel>
</rss>

