<?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: SQL Case Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848833#M652552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;David Gilligan wrote:&lt;/P&gt;
&lt;P&gt;I understand that QlikView does not like MS SQL CASE statements so I am trying to work around this.&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've never had a problem with CASE statements in SQL SELECT. Everything after the "SQL" is passed directly to the DBMS and is not processed by QV. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jul 2015 09:06:18 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2015-07-10T09:06:18Z</dc:date>
    <item>
      <title>SQL Case Statement</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848831#M652550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that QlikView does not like MS SQL CASE statements so I am trying to work around this.&amp;nbsp; It will get more complex but I have to start getting away from the SQL way for this.&amp;nbsp; I basically want to do a select like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SLELECT something1, something2, ...., &lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; UseRate &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt; font-family: Consolas;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;CASE&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;WHEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Consolas;"&gt;[UKURS]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt; font-family: Consolas;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; 0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;ELSE&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Consolas;"&gt;[UKURS]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;END&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;This will turn all 0s to 1s....what I really want to do next is look up, in another table, an actual rate based on a different field, like a subselect.... SELECT Rate from rateTable WHERE Country = 'UK' AND Month = 4 and Year = 2015.....but I must learn to walk before I can run....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;Thanks for any help,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;Dave&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 08:59:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848831#M652550</guid>
      <dc:creator />
      <dc:date>2015-07-10T08:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Case Statement</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848832#M652551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; WHEN condition_1 THEN result_1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; WHEN condition_2 THEN result_2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; WHEN condition_n THEN result_n&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ELSE result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 09:01:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848832#M652551</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2015-07-10T09:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Case Statement</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848833#M652552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;David Gilligan wrote:&lt;/P&gt;
&lt;P&gt;I understand that QlikView does not like MS SQL CASE statements so I am trying to work around this.&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've never had a problem with CASE statements in SQL SELECT. Everything after the "SQL" is passed directly to the DBMS and is not processed by QV. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 09:06:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848833#M652552</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-07-10T09:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Case Statement</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848834#M652553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Vikas, maybe I am not clear or I misunderstand you.&amp;nbsp; Can I use a CASE in SQL in QlikView...it appears to throw an error when it hits a case in a sql block...my code works perfectly in SQL Management Studio but dies when I bring it into QlikView. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 09:06:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848834#M652553</guid>
      <dc:creator />
      <dc:date>2015-07-10T09:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Case Statement</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848835#M652554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is what I thought too....hopefully I just missed something when I copied...let me give another try but it takes a while before I will know, it is a big load but lockally only runs 1 time per day.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 09:09:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848835#M652554</guid>
      <dc:creator />
      <dc:date>2015-07-10T09:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Case Statement</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848836#M652555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you have a SQL before the SELECT?&lt;/P&gt;&lt;P&gt;To Test the SQL statement, but a TOP clause for testing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL SELECT TOP 1000 ......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 09:41:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848836#M652555</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-07-10T09:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Case Statement</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848837#M652556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Must have meen a typing mistake as it does work and the article that stated that "CASE" does not work when loading tables, actually refers to using a CASE statement in a LOAD not SQL created tables.&amp;nbsp; This is good news for me.&amp;nbsp; Thanks for the responses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 10:41:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Case-Statement/m-p/848837#M652556</guid>
      <dc:creator />
      <dc:date>2015-07-10T10:41:52Z</dc:date>
    </item>
  </channel>
</rss>

