<?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: Case When Help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503306#M188055</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, i think ' ' mark are missing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New';"&gt;CASE&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="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #0000ff;"&gt;WHEN&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New';"&gt; vhl_1_age = &lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #008080;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #0000ff;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #800080;"&gt;'A'&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="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #800080;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; color: #0000ff;"&gt;WHEN&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt;"&gt; vhl_1_age = &lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; color: #008080;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; color: #0000ff;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt;"&gt;'B'&lt;/SPAN&gt;&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="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #800080;"&gt;ELSE 'vhl_1_age'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....was missing&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="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #800080;"&gt;END&amp;nbsp; AS&amp;nbsp;&amp;nbsp; vhl_1_age_Grouping&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.......................................................................&lt;/P&gt;&lt;P&gt;below is working in mytable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT productid, productname, unitprice,&lt;/P&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;P&gt;WHEN unitprice &amp;lt; 20.00 THEN 'Low'&lt;/P&gt;&lt;P&gt;WHEN unitprice &amp;lt; 40.00 THEN 'Medium'&lt;/P&gt;&lt;P&gt;WHEN unitprice &amp;gt;= 40.00 THEN 'High'&lt;/P&gt;&lt;P&gt;ELSE 'Unknown'&lt;/P&gt;&lt;P&gt;END AS pricerange&lt;/P&gt;&lt;P&gt;FROM Production.Products;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Oct 2013 10:40:45 GMT</pubDate>
    <dc:creator>israrkhan</dc:creator>
    <dc:date>2013-10-22T10:40:45Z</dc:date>
    <item>
      <title>Case When Help</title>
      <link>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503304#M188053</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'm new to qlikview. Can somebody help me explain why this case statement doesn't work in the back end?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;CASE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;WHEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; vhl_1_age = &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;'A'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;WHEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; vhl_1_age = &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;'B'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;ELSE vhl_1_age&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;END&amp;nbsp; AS&amp;nbsp;&amp;nbsp; vhl_1_age_Grouping&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 10:31:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503304#M188053</guid>
      <dc:creator />
      <dc:date>2013-10-22T10:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Case When Help</title>
      <link>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503305#M188054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The when case should be used only with full scripts, example:&lt;/P&gt;&lt;P&gt;Case var 1&lt;/P&gt;&lt;P&gt;When 2&lt;/P&gt;&lt;P&gt;load * from table1&lt;/P&gt;&lt;P&gt;when 3&lt;/P&gt;&lt;P&gt;Load * from table2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For what you are trying to do, use the if statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 10:36:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503305#M188054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-22T10:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Case When Help</title>
      <link>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503306#M188055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, i think ' ' mark are missing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New';"&gt;CASE&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="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #0000ff;"&gt;WHEN&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New';"&gt; vhl_1_age = &lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #008080;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #0000ff;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #800080;"&gt;'A'&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="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #800080;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; color: #0000ff;"&gt;WHEN&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt;"&gt; vhl_1_age = &lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; color: #008080;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; color: #0000ff;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt;"&gt;'B'&lt;/SPAN&gt;&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="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #800080;"&gt;ELSE 'vhl_1_age'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....was missing&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="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #800080;"&gt;END&amp;nbsp; AS&amp;nbsp;&amp;nbsp; vhl_1_age_Grouping&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.......................................................................&lt;/P&gt;&lt;P&gt;below is working in mytable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT productid, productname, unitprice,&lt;/P&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;P&gt;WHEN unitprice &amp;lt; 20.00 THEN 'Low'&lt;/P&gt;&lt;P&gt;WHEN unitprice &amp;lt; 40.00 THEN 'Medium'&lt;/P&gt;&lt;P&gt;WHEN unitprice &amp;gt;= 40.00 THEN 'High'&lt;/P&gt;&lt;P&gt;ELSE 'Unknown'&lt;/P&gt;&lt;P&gt;END AS pricerange&lt;/P&gt;&lt;P&gt;FROM Production.Products;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 10:40:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503306#M188055</guid>
      <dc:creator>israrkhan</dc:creator>
      <dc:date>2013-10-22T10:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Case When Help</title>
      <link>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503307#M188056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try using a nested if or a pick statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;if(vhl_1_age=0,'A', if(vhl_1_age=1,'B',vhl_1_age)) as vhl_1_age_Grouping&lt;/P&gt;&lt;P&gt;FROM ...mysource...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;pick(vhl_1_age+1),vhl_1_age,'A','B') as vhl_1_age_Grouping&lt;/P&gt;&lt;P&gt;FROM ...mysource...;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 10:42:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503307#M188056</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-10-22T10:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Case When Help</title>
      <link>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503308#M188057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to do the same in the script so i do not have to convert the values in every graph, but the read fail. I have tried it directly in SQL manager and it works, but not in the script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have tried i bit different versions, but it fails every time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load * &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;select &lt;/P&gt;&lt;P&gt;f.BirthDate As Fødselsdag,&lt;/P&gt;&lt;P&gt;f.ExtType as Skyldnertype,&lt;/P&gt;&lt;P&gt;CASE &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN f.ExtType = '1' THEN 'Privat'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN f.ExtType =&amp;nbsp; '2' THEN 'Bedrift'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN f.ExtType =&amp;nbsp; '3' THEN 'ENK'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&amp;nbsp; 'Ukjent'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&amp;nbsp; as Skyldnertype,&lt;/P&gt;&lt;P&gt;d.StartedDate as KampanjeStart,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 13:18:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503308#M188057</guid>
      <dc:creator />
      <dc:date>2013-11-26T13:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Case When Help</title>
      <link>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503309#M188058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And as I read my own code I found what was wrong. Same name in two settings worked fine in SQL manager, but not in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i changed name og one field and it works fine, just as I wanted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 13:22:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Case-When-Help/m-p/503309#M188058</guid>
      <dc:creator />
      <dc:date>2013-11-26T13:22:45Z</dc:date>
    </item>
  </channel>
</rss>

