<?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: Load Script - if statement with string concatenation in Qlik Learning Discussions</title>
    <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659045#M266</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Just to be sure, try replacing the &amp;amp;'-'&amp;amp; with &amp;amp;'_'&amp;amp; or some other separator. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 05 Oct 2014 19:10:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-10-05T19:10:26Z</dc:date>
    <item>
      <title>Load Script - if statement with string concatenation</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659041#M262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having problems to have string concatenation in an if statement in a load script SQL statement.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;Select IF(Month(`TxDate`) &amp;lt; 8, 'Season ' + Year(`TxDate`), 'Season ' + (Year(`TxDate`)+1)) AS Season&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain what I am doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Oct 2014 13:36:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659041#M262</guid>
      <dc:creator />
      <dc:date>2014-10-05T13:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - if statement with string concatenation</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659042#M263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Colin,&lt;/P&gt;&lt;P&gt;If() not is sintax SQL, is sintax QV.&lt;/P&gt;&lt;P&gt;You use&lt;/P&gt;&lt;P&gt;case&lt;BR /&gt; When ...&amp;nbsp;&amp;nbsp; then&lt;/P&gt;&lt;P&gt;else ..&lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;P&gt;as Season.&lt;/P&gt;&lt;P&gt;But Month Sintax depending on Your DB.&lt;/P&gt;&lt;P&gt;You can use Preceding Load :&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;If(Month(...),........) as Season;&lt;/P&gt;&lt;P&gt;SQL Select *&lt;/P&gt;&lt;P&gt;from Table;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Antonio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Oct 2014 14:42:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659042#M263</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2014-10-05T14:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - if statement with string concatenation</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659043#M264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Antonio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the If statement is not the issue as it is working fine. It is the concatenation which is working not as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression:&lt;/P&gt;&lt;P&gt;('Season ' &amp;amp; (Year(`TxDate`)-1) &amp;amp; '-' &amp;amp; (Year(`TxDate`))&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;is resulting in 0.&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;I am sure that Year works fine as I tried it as a separate expression. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I am afraid that &amp;amp; is being interpreted as a logical AND expression.&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;Btw - I am using MySQL but this is not the issue.&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;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Colin&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Oct 2014 15:07:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659043#M264</guid>
      <dc:creator />
      <dc:date>2014-10-05T15:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - if statement with string concatenation</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659044#M265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Colin,&lt;/P&gt;&lt;P&gt;Ok, MySql has If() Sintax.&lt;/P&gt;&lt;P&gt;Tray to remove ' in Year('TxDate')&amp;nbsp; -&amp;gt; Year(TxDate)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Oct 2014 15:12:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659044#M265</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2014-10-05T15:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - if statement with string concatenation</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659045#M266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Just to be sure, try replacing the &amp;amp;'-'&amp;amp; with &amp;amp;'_'&amp;amp; or some other separator. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Oct 2014 19:10:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659045#M266</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-05T19:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - if statement with string concatenation</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659046#M267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved this issue with a preceding load as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;IF(Month(`TxDate`) &amp;lt; 8, 'Season ' + Year(`TxDate`), 'Season ' + (Year(`TxDate`)+1)) AS Season;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;TxDate&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;From ...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 21:45:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Load-Script-if-statement-with-string-concatenation/m-p/659046#M267</guid>
      <dc:creator />
      <dc:date>2014-10-06T21:45:04Z</dc:date>
    </item>
  </channel>
</rss>

