<?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..then..elseif..endif in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792954#M662828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Frank,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like I said, you can't use elseif like that for an if statement when creating fields, you'll need to rework the elseif to get that to work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Jan 2015 17:39:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-01-29T17:39:23Z</dc:date>
    <item>
      <title>If..then..elseif..endif</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792950#M662824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to get this compound if to work but having problems with the syntax.&amp;nbsp; any ideas?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Bill To Address]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 3670 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 5970, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PDorSP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'PD', 'MY', &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PDorSP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'SP', &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SDSRP2&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'PEA' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 'SOY', 'MY', &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SDSRP2&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&amp;gt; 'PEA' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 'SOY', 'LI'))))),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//*&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; if (PDorSP = 'PD', PTSM, &lt;BR /&gt; If(PDorSP = 'SP', STSM,&lt;BR /&gt; If(PDorSP = 'FB', 'PB',&lt;BR /&gt; If(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'MP' or &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'FP',PTSM,&lt;BR /&gt; If(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'MS' or &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'FS',STSM,&lt;BR /&gt; if (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'M' or &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'F' or &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Z' or &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Y', &lt;BR /&gt; if (SDSRP1 = 'PD', PTSM, &lt;BR /&gt; if (SDSRP1 = 'SP', STSM,&lt;BR /&gt; if (SDSRP1 = 'FB' or SDSRP1 = 'PKG' or SDSRP1 = 'CMF' or SDSRP1 = 'RAW' or SDSRP1 = 'OTH', 'PB',)))))))))&lt;BR /&gt; end if as &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Territory Manager]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 17:03:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792950#M662824</guid>
      <dc:creator />
      <dc:date>2015-01-29T17:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: If..then..elseif..endif</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792951#M662825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Change all conditions like&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #800000; font-family: 'courier new', courier;"&gt;[Bill To Address]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt; = 3670 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;or&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;&lt;EM&gt; 5970&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;that don't work in QlikView, into&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #800000; font-family: 'courier new', courier;"&gt;([Bill To Address]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt; = 3670) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;or&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt; ([&lt;SPAN style="color: #800000;"&gt;Bill To Address]&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d;"&gt; = &lt;/SPAN&gt;5970)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Use lots of indentation and parentheses to separate the different clauses in your statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Best, Peter&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 17:07:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792951#M662825</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-01-29T17:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: If..then..elseif..endif</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792952#M662826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Frank,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the If syntax within the QV load script isn't in that format, needs to be like the below&lt;/P&gt;&lt;P&gt;IF(Evaluation,[True Condition],[False Condition])&lt;/P&gt;&lt;P&gt;You can't you elseif like that when creating a field.&lt;/P&gt;&lt;P&gt;Also using the Or/And like that will not give the required result, you need to specify the OR/AND separately&lt;/P&gt;&lt;P&gt;i.e&lt;/P&gt;&lt;P&gt;If([Bill to Address]=3670 OR [Bill to Address]=5970, [True], [False})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope that helps&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 17:07:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792952#M662826</guid>
      <dc:creator />
      <dc:date>2015-01-29T17:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: If..then..elseif..endif</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792953#M662827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank Peter &amp;amp; Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made the correction you suggested, however I'm still receiving an error when the script runs.&amp;nbsp; I'm not sure that the else is working properly.&amp;nbsp; As you will notice all the "if" after the else are not in blue the way they should be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Bill To Address]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 3670 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Bill To Address]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 5970, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PDorSP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'PD', 'MY', &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PDorSP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'SP', &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SDSRP2&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'PEA' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 'SOY', 'MY', &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SDSRP2&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&amp;gt; 'PEA' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SDSRP2&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&amp;gt; 'SOY', 'LI'))))),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//*&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; if (PDorSP = 'PD', PTSM, &lt;BR /&gt; If(PDorSP = 'SP', STSM,&lt;BR /&gt; If(PDorSP = 'FB', 'PB',&lt;BR /&gt; If(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'MP' or &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'FP',PTSM,&lt;BR /&gt; If(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'MS' or &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'FS',STSM,&lt;BR /&gt; if (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'M' or &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'F' or &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Z' or &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Line Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Y', &lt;BR /&gt; if (SDSRP1 = 'PD', PTSM, &lt;BR /&gt; if (SDSRP1 = 'SP', STSM,&lt;BR /&gt; if (SDSRP1 = 'FB' or SDSRP1 = 'PKG' or SDSRP1 = 'CMF' or SDSRP1 = 'RAW' or SDSRP1 = 'OTH', 'PB',)))))))))&lt;BR /&gt; end if as &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Territory Manager]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 17:32:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792953#M662827</guid>
      <dc:creator />
      <dc:date>2015-01-29T17:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: If..then..elseif..endif</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792954#M662828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Frank,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like I said, you can't use elseif like that for an if statement when creating fields, you'll need to rework the elseif to get that to work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 17:39:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792954#M662828</guid>
      <dc:creator />
      <dc:date>2015-01-29T17:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: If..then..elseif..endif</title>
      <link>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792955#M662829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The IF you use in column assignments is a function with either two or three parameters. It doesn't have an ELSE clause because the else clause is the third parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF THEN ELSE statements are control statements and allowed only outside of LOAD statements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 17:41:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-then-elseif-endif/m-p/792955#M662829</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-01-29T17:41:03Z</dc:date>
    </item>
  </channel>
</rss>

