<?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: How can achieve SQL Case Satetment in Qlikview in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-achieve-SQL-Case-Satetment-in-Qlikview/m-p/1576669#M741475</link>
    <description>After too much research, Finally I am able to replicate the SQL code in Qlikview Script. This will help others&lt;BR /&gt;Solution :&lt;BR /&gt;&lt;BR /&gt;CaseTesting:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;UserName, Values&lt;BR /&gt;Jel\Vijay.sahu, 1&lt;BR /&gt;Jel\Amit.Singh, 2&lt;BR /&gt;CLOUD\admin , 3&lt;BR /&gt;ad,4&lt;BR /&gt;];&lt;BR /&gt;STORE CaseTesting INTO 'CaseTesting.qvd' (QVD);&lt;BR /&gt;&lt;BR /&gt;Drop Table CaseTesting;&lt;BR /&gt;&lt;BR /&gt;CaseReplace:&lt;BR /&gt;//&lt;BR /&gt;//LOAD IF (WildMatch(UserName,'*CLOUD\*'),UPPER(REplace(UserName,'CLOUD\',''))) AS UserName;&lt;BR /&gt;LOAD IF (WildMatch(UserName,'*Jel\*'),UPPER(REplace(UserName,'Jel\','')),(IF (WildMatch(UserName,'*CLOUD\*'),UPPER(REplace(UserName,'CLOUD\',''))))) AS UserName,&lt;BR /&gt;Values&lt;BR /&gt;FROM&lt;BR /&gt;CaseTesting.qvd&lt;BR /&gt;(qvd);&lt;BR /&gt;</description>
    <pubDate>Sun, 05 May 2019 18:35:03 GMT</pubDate>
    <dc:creator>vijaysahu2</dc:creator>
    <dc:date>2019-05-05T18:35:03Z</dc:date>
    <item>
      <title>How can achieve SQL Case Satetment in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-achieve-SQL-Case-Satetment-in-Qlikview/m-p/1576668#M741474</link>
      <description>&lt;P&gt;Hi&amp;nbsp; All&lt;/P&gt;&lt;P&gt;I am trying to convert the SQL code in Qlikview Script. I have loaded the Qvd file from SQL server data and now want to use the Case condition on a column to replace the value.&lt;/P&gt;&lt;P&gt;I have SQL code like below&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Consolas" color="#0000ff"&gt;SELECT&lt;/FONT&gt; &lt;FONT face="Consolas" color="#0000ff"&gt;DISTINCT&lt;/FONT&gt; &lt;FONT face="Consolas" color="#0000ff"&gt;CASE&lt;/FONT&gt; &lt;FONT face="Consolas" color="#0000ff"&gt;WHEN&lt;/FONT&gt;&lt;FONT face="Consolas"&gt; u&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;.&lt;/FONT&gt;&lt;FONT face="Consolas"&gt;username &lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;LIKE&lt;/FONT&gt; &lt;FONT face="Consolas" color="#ff0000"&gt;'%Jel%'&lt;/FONT&gt; &lt;FONT face="Consolas" color="#0000ff"&gt;THEN&lt;/FONT&gt; &lt;FONT face="Consolas" color="#ff00ff"&gt;UPPER&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;(&lt;/FONT&gt;&lt;FONT face="Consolas" color="#ff00ff"&gt;REPLACE&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;(&lt;/FONT&gt;&lt;FONT face="Consolas"&gt;U&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;.&lt;/FONT&gt;&lt;FONT face="Consolas"&gt;UserName&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;,&lt;/FONT&gt;&lt;FONT face="Consolas" color="#ff0000"&gt;'JEL\'&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;,&lt;/FONT&gt;&lt;FONT face="Consolas" color="#ff0000"&gt;''&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Consolas" color="#0000ff"&gt;WHEN&lt;/FONT&gt;&lt;FONT face="Consolas"&gt; u&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;.&lt;/FONT&gt;&lt;FONT face="Consolas"&gt;username &lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;LIKE&lt;/FONT&gt; &lt;FONT face="Consolas" color="#ff0000"&gt;'%&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;FONT face="Consolas" color="#ff0000"&gt;CLOUD%'&lt;/FONT&gt; &lt;FONT face="Consolas" color="#0000ff"&gt;THEN&lt;/FONT&gt; &lt;FONT face="Consolas" color="#ff00ff"&gt;UPPER&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;(&lt;/FONT&gt;&lt;FONT face="Consolas" color="#ff00ff"&gt;REPLACE&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;(&lt;/FONT&gt;&lt;FONT face="Consolas"&gt;U&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;.&lt;/FONT&gt;&lt;FONT face="Consolas"&gt;UserName&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;,&lt;/FONT&gt;&lt;FONT face="Consolas" color="#ff0000"&gt;'CLOUD\'&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;,&lt;/FONT&gt;&lt;FONT face="Consolas" color="#ff0000"&gt;''&lt;/FONT&gt;&lt;FONT face="Consolas" color="#808080"&gt;))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Consolas" color="#0000ff"&gt;ELSE&lt;/FONT&gt; &lt;FONT face="Consolas" color="#ff0000"&gt;''&lt;/FONT&gt; &lt;FONT face="Consolas" color="#0000ff"&gt;END&lt;/FONT&gt; &lt;FONT face="Consolas" color="#0000ff"&gt;AS&lt;/FONT&gt; &lt;FONT face="Consolas" color="#ff0000"&gt;'LINK'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Consolas" color="#0000ff"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Consolas"&gt; UserTable &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&amp;lt;Qlikview&amp;nbsp; code below and sample Data&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;CaseTesting:&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT size="1" color="#0000ff"&gt;LOAD&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="1"&gt; * &lt;/FONT&gt;&lt;FONT size="1" color="#0000ff"&gt;INLINE&lt;/FONT&gt; &lt;FONT size="1" color="#800000"&gt;[&lt;BR /&gt;UserName, Values&lt;BR /&gt;Jel\Vijay.sahu, 1&lt;BR /&gt;Jel\Amit.Singh, 2&lt;BR /&gt;CLOUD\admin , 3&lt;BR /&gt;]&lt;/FONT&gt;&lt;FONT size="1"&gt;;&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT size="1" color="#0000ff"&gt;STORE&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="1"&gt; CaseTesting &lt;/FONT&gt;&lt;FONT size="1" color="#0000ff"&gt;INTO&lt;/FONT&gt;&lt;FONT size="1"&gt; 'CaseTesting.qvd' (&lt;/FONT&gt;&lt;FONT size="1" color="#0000ff"&gt;QVD&lt;/FONT&gt;&lt;FONT size="1"&gt;);&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;How can I apply the similar case statement on Username column so the result should like below&lt;/P&gt;&lt;P&gt;UserName, Value&lt;/P&gt;&lt;P&gt;VIJAY.SAHU , 1&lt;/P&gt;&lt;P&gt;AMIT.SINGH, 2&lt;/P&gt;&lt;P&gt;ADMIN, 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-achieve-SQL-Case-Satetment-in-Qlikview/m-p/1576668#M741474</guid>
      <dc:creator>vijaysahu2</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can achieve SQL Case Satetment in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-achieve-SQL-Case-Satetment-in-Qlikview/m-p/1576669#M741475</link>
      <description>After too much research, Finally I am able to replicate the SQL code in Qlikview Script. This will help others&lt;BR /&gt;Solution :&lt;BR /&gt;&lt;BR /&gt;CaseTesting:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;UserName, Values&lt;BR /&gt;Jel\Vijay.sahu, 1&lt;BR /&gt;Jel\Amit.Singh, 2&lt;BR /&gt;CLOUD\admin , 3&lt;BR /&gt;ad,4&lt;BR /&gt;];&lt;BR /&gt;STORE CaseTesting INTO 'CaseTesting.qvd' (QVD);&lt;BR /&gt;&lt;BR /&gt;Drop Table CaseTesting;&lt;BR /&gt;&lt;BR /&gt;CaseReplace:&lt;BR /&gt;//&lt;BR /&gt;//LOAD IF (WildMatch(UserName,'*CLOUD\*'),UPPER(REplace(UserName,'CLOUD\',''))) AS UserName;&lt;BR /&gt;LOAD IF (WildMatch(UserName,'*Jel\*'),UPPER(REplace(UserName,'Jel\','')),(IF (WildMatch(UserName,'*CLOUD\*'),UPPER(REplace(UserName,'CLOUD\',''))))) AS UserName,&lt;BR /&gt;Values&lt;BR /&gt;FROM&lt;BR /&gt;CaseTesting.qvd&lt;BR /&gt;(qvd);&lt;BR /&gt;</description>
      <pubDate>Sun, 05 May 2019 18:35:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-achieve-SQL-Case-Satetment-in-Qlikview/m-p/1576669#M741475</guid>
      <dc:creator>vijaysahu2</dc:creator>
      <dc:date>2019-05-05T18:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can achieve SQL Case Satetment in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-achieve-SQL-Case-Satetment-in-Qlikview/m-p/1595187#M741476</link>
      <description>&lt;P&gt;Check the following Help link if you are still stuck on this one, may help:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptControlStatements/Switch.htm" target="_blank"&gt;http://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptControlStatements/Switch.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 14:12:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-achieve-SQL-Case-Satetment-in-Qlikview/m-p/1595187#M741476</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-06-24T14:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can achieve SQL Case Satetment in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-achieve-SQL-Case-Satetment-in-Qlikview/m-p/1595319#M741477</link>
      <description>&lt;P&gt;Thanks Brett&amp;nbsp; for your link.. issue is resolved&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 20:19:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-achieve-SQL-Case-Satetment-in-Qlikview/m-p/1595319#M741477</guid>
      <dc:creator>vijaysahu2</dc:creator>
      <dc:date>2019-06-24T20:19:02Z</dc:date>
    </item>
  </channel>
</rss>

