<?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: How to add a calculated field？ in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-add-a-calculated-field/m-p/874750#M305476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;there are some error message.&lt;/P&gt;&lt;P&gt;SQL##f - Sqlstate:37000, errorcode:156, errormsg:[microsoft][odbc sql server driver][sqo server]incorrect syntax near the keyword 'if'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 May 2015 07:28:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-05-05T07:28:01Z</dc:date>
    <item>
      <title>How to add a calculated field？</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-a-calculated-field/m-p/874748#M305474</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;load script as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL select&lt;/P&gt;&lt;P&gt;month,&lt;/P&gt;&lt;P&gt;region,&lt;/P&gt;&lt;P&gt;country,&lt;/P&gt;&lt;P&gt;reason_code,&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;from....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to add a calculated field named 'buyback' base on reason_code, logic is left(isnull(reason_code),'aaa',3)='New'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 06:44:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-a-calculated-field/m-p/874748#M305474</guid>
      <dc:creator />
      <dc:date>2015-05-05T06:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a calculated field？</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-a-calculated-field/m-p/874749#M305475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if I have understood your definition of buyback correctly - try something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Left(reason_code, 3)='New', 1, 0) As buyback&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL select&lt;/P&gt;&lt;P&gt;month,&lt;/P&gt;&lt;P&gt;region,&lt;/P&gt;&lt;P&gt;country,&lt;/P&gt;&lt;P&gt;reason_code,&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;from....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(If reason code is null or not equal to New, buyback will be 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 06:52:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-a-calculated-field/m-p/874749#M305475</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-05-05T06:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a calculated field？</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-a-calculated-field/m-p/874750#M305476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;there are some error message.&lt;/P&gt;&lt;P&gt;SQL##f - Sqlstate:37000, errorcode:156, errormsg:[microsoft][odbc sql server driver][sqo server]incorrect syntax near the keyword 'if'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 07:28:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-a-calculated-field/m-p/874750#M305476</guid>
      <dc:creator />
      <dc:date>2015-05-05T07:28:01Z</dc:date>
    </item>
  </channel>
</rss>

