<?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 SQL Select - Syntax in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961821#M949808</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have updated that solution now...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, using case I think you should write your statement like this instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN [Document No_] &amp;gt; 0 THEN 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;END AS Debitor_Sign&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Dec 2015 08:44:00 GMT</pubDate>
    <dc:creator>henrikalmen</dc:creator>
    <dc:date>2015-12-18T08:44:00Z</dc:date>
    <item>
      <title>If statement in SQL Select - Syntax</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961816#M949803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, got problem with syntax. Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to get additional column in my table with conditional value 0 or 1 (True or False) - I do it for the first time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;...&amp;nbsp; &lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;&amp;nbsp; Tabl_contract.Code AS "Contract_Number",&lt;/P&gt;&lt;P&gt;&amp;nbsp; cle."Customer No_" AS "Customer_Number2",&lt;/P&gt;&lt;P&gt;&amp;nbsp; cle."Document No_" AS "Debitor_document",&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ((cle."Document No_" &amp;gt; 0), 1, 0) AS "Debitor_Sign"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM "EUR-VENDEN".dbo."EUR VENDEN$Cust_ Ledger Entry" AS cle&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I got error in IF statement.. &lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/108189_1.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ((cle."Document No_" &amp;gt; 0), 1, 0) AS "Debitor_Sign"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Dec 2015 06:49:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961816#M949803</guid>
      <dc:creator>sculptorlv</dc:creator>
      <dc:date>2015-12-07T06:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in SQL Select - Syntax</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961817#M949804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that you are trying to mix SQL with QlikView scripting language.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should probably use &lt;A href="https://community.qlik.com/qlik-blogpost/2972"&gt;Preceding Load&lt;/A&gt; and do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MyTable:&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 ([Debitor_document] &amp;gt; 0), 1, 0) AS Debitor_Sign&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp; Tabl_contract.Code AS Contract_Number,&lt;/P&gt;&lt;P&gt;&amp;nbsp; cle.[Customer No_] AS Customer_Number2,&lt;/P&gt;&lt;P&gt;&amp;nbsp; cle.[Document No_] AS Debitor_document&lt;/P&gt;&lt;P&gt;FROM "EUR-VENDEN".dbo."EUR VENDEN$Cust_ Ledger Entry" As cle ...&lt;/P&gt;&lt;P&gt;join ... as Tabl_contract;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;EDIT:&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; I just realised I entered the wrong field name in the preceding load. I have changed that now.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 15:06:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961817#M949804</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2015-12-16T15:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in SQL Select - Syntax</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961818#M949805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can use a case in sql server &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;SQL SELECT&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&amp;nbsp; Tabl_contract.Code AS "Contract_Number",&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&amp;nbsp; cle."Customer No_" AS "Customer_Number2",&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&amp;nbsp; cle."Document No_" AS "Debitor_document",&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;..&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; case&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;"Debitor_Sign"=&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;cle."Document No_" &amp;gt; 0 then 1&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else 0&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;.....&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt; FROM "EUR-VENDEN".dbo."EUR VENDEN$Cust_ Ledger Entry" AS cle&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://msdn.microsoft.com/it-it/library/ms181765(v=sql.120).aspx" title="https://msdn.microsoft.com/it-it/library/ms181765(v=sql.120).aspx"&gt;https://msdn.microsoft.com/it-it/library/ms181765(v=sql.120).aspx&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 19:03:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961818#M949805</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-12-16T19:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in SQL Select - Syntax</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961819#M949806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to do this with CASE, didn't work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 12:23:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961819#M949806</guid>
      <dc:creator>sculptorlv</dc:creator>
      <dc:date>2015-12-17T12:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in SQL Select - Syntax</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961820#M949807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;Have you tried my suggested preceding load solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 13:08:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961820#M949807</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2015-12-17T13:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in SQL Select - Syntax</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961821#M949808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have updated that solution now...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, using case I think you should write your statement like this instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN [Document No_] &amp;gt; 0 THEN 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;END AS Debitor_Sign&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 08:44:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961821#M949808</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2015-12-18T08:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in SQL Select - Syntax</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961822#M949809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No I didn't. Got problems with that, still trying to understand this function by manuals.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 08:50:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961822#M949809</guid>
      <dc:creator>sculptorlv</dc:creator>
      <dc:date>2015-12-18T08:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in SQL Select - Syntax</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961823#M949810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually I have doubled rows this the same Document No_ value. And there are two only options for Applied column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Both Applied volumes = 0 for each of two Document No_ value&lt;/P&gt;&lt;P&gt;2. First Applied =1, second Applied = 0 ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, I need only ONE row of Document No_ with the value Applied 1 (if one of the value =1) or 0 (if both Applied values = 0)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 12:37:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961823#M949810</guid>
      <dc:creator>sculptorlv</dc:creator>
      <dc:date>2015-12-18T12:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in SQL Select - Syntax</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961824#M949811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not quite sure what you are trying to do. Can you post some sample data? What the tables look like, some data in them, and what you would want the result to look like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 13:30:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-in-SQL-Select-Syntax/m-p/961824#M949811</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2015-12-18T13:30:57Z</dc:date>
    </item>
  </channel>
</rss>

