<?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 SQL Select and Case in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-Select-and-Case/m-p/279302#M1203196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;I have one question, is possible use in qlikview "sql select" with "case"? Today i test this script without the "case" and work all perfect, when i add the "case" and reload the data, nothing happend, don't return data or errors.&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;César Estrada&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL select&lt;BR /&gt;case&lt;BR /&gt;when len(month(fch1)) = '1' then cast(year(fch1) as char(4))+'0'+cast(month(fch1) as varchar(2))&lt;BR /&gt;when len(month(fch1)) = '2' then cast(year(fch1) as char(4))+cast(month(fch1) as varchar(2))&lt;BR /&gt;else '1234'&lt;BR /&gt;end,&lt;BR /&gt;year(fch2) YEAR, month(fch2) MONTH,&lt;BR /&gt;year(fch1) YEARVNC, month(fch1) MONTHVNC, h.mod,&lt;BR /&gt;h.cod, h.nro, fch2 as DATE, nrop as NUMPRO,&lt;BR /&gt;nomp as NAMPRO, text2 as TEXT&lt;BR /&gt;from I&lt;BR /&gt;left join h&lt;BR /&gt;on h.mod = i.mod&lt;BR /&gt;and h.cod = i.cod&lt;BR /&gt;and h.nro = i.nro&lt;BR /&gt;where i.accoun = '123456'&lt;BR /&gt;and h.fch = '09/28/2010';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Sep 2010 20:52:39 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-28T20:52:39Z</dc:date>
    <item>
      <title>SQL Select and Case</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Select-and-Case/m-p/279302#M1203196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;I have one question, is possible use in qlikview "sql select" with "case"? Today i test this script without the "case" and work all perfect, when i add the "case" and reload the data, nothing happend, don't return data or errors.&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;César Estrada&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL select&lt;BR /&gt;case&lt;BR /&gt;when len(month(fch1)) = '1' then cast(year(fch1) as char(4))+'0'+cast(month(fch1) as varchar(2))&lt;BR /&gt;when len(month(fch1)) = '2' then cast(year(fch1) as char(4))+cast(month(fch1) as varchar(2))&lt;BR /&gt;else '1234'&lt;BR /&gt;end,&lt;BR /&gt;year(fch2) YEAR, month(fch2) MONTH,&lt;BR /&gt;year(fch1) YEARVNC, month(fch1) MONTHVNC, h.mod,&lt;BR /&gt;h.cod, h.nro, fch2 as DATE, nrop as NUMPRO,&lt;BR /&gt;nomp as NAMPRO, text2 as TEXT&lt;BR /&gt;from I&lt;BR /&gt;left join h&lt;BR /&gt;on h.mod = i.mod&lt;BR /&gt;and h.cod = i.cod&lt;BR /&gt;and h.nro = i.nro&lt;BR /&gt;where i.accoun = '123456'&lt;BR /&gt;and h.fch = '09/28/2010';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Sep 2010 20:52:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Select-and-Case/m-p/279302#M1203196</guid>
      <dc:creator />
      <dc:date>2010-09-28T20:52:39Z</dc:date>
    </item>
    <item>
      <title>SQL Select and Case</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Select-and-Case/m-p/279303#M1203197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try giving the field a name?&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;SQL select&lt;BR /&gt;case&lt;BR /&gt;when len(month(fch1)) = '1' then cast(year(fch1) as char(4))+'0'+cast(month(fch1) as varchar(2))&lt;BR /&gt;when len(month(fch1)) = '2' then cast(year(fch1) as char(4))+cast(month(fch1) as varchar(2))&lt;BR /&gt;else '1234'&lt;BR /&gt;end As Code,&lt;BR /&gt;...&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;EDIT: It looks like QlikView will create a name for the field if you don't add it. I verified that a case should work and I did one similar to yours that works fine. I only have Oracle DBs here, so I can't test the T-SQL syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Sep 2010 21:02:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Select-and-Case/m-p/279303#M1203197</guid>
      <dc:creator />
      <dc:date>2010-09-28T21:02:14Z</dc:date>
    </item>
    <item>
      <title>SQL Select and Case</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Select-and-Case/m-p/279304#M1203198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Sep 2010 21:11:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Select-and-Case/m-p/279304#M1203198</guid>
      <dc:creator />
      <dc:date>2010-09-28T21:11:54Z</dc:date>
    </item>
    <item>
      <title>SQL Select and Case</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Select-and-Case/m-p/279305#M1203199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops, I just edited to suggest that the name wasn't the problem. Perhaps, your case was too long or had a QlikView reserved word or something that prevented QlikView from giving it a default name. Interesting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Sep 2010 21:14:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Select-and-Case/m-p/279305#M1203199</guid>
      <dc:creator />
      <dc:date>2010-09-28T21:14:10Z</dc:date>
    </item>
  </channel>
</rss>

