<?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 MATCH IN JOINED SQL TABLES in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899880#M993129</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sasidhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked, thank you very much! Not sure why it didn't work before, I tried all different options. Perhaps I might have done something wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jul 2015 19:16:18 GMT</pubDate>
    <dc:creator>infock12</dc:creator>
    <dc:date>2015-07-17T19:16:18Z</dc:date>
    <item>
      <title>IF MATCH IN JOINED SQL TABLES</title>
      <link>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899873#M993122</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 am using an IF(Match function to convert a text value. Basically, if an answer for a particular questions is answered as 'Yes', covert it to 'No' and vice versa. The query is below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: blue; font-size: 10pt; font-family: Calibri;"&gt;SELECT&lt;/STRONG&gt;&lt;SPAN style="color: black; font-size: 10pt; font-family: Calibri;"&gt; &lt;STRONG&gt;[QuestionNumber]&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;,C.Question&lt;/STRONG&gt; &lt;STRONG&gt;as&lt;/STRONG&gt; &lt;STRONG&gt;Questions&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;,Response&lt;/STRONG&gt; &lt;STRONG&gt;as&lt;/STRONG&gt; &lt;STRONG&gt;OriginalResponse&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;,IF(Match(QuestionNumber,&lt;/STRONG&gt; &lt;STRONG&gt;25,&lt;/STRONG&gt; &lt;STRONG&gt;38,&lt;/STRONG&gt; &lt;STRONG&gt;83,&lt;/STRONG&gt; &lt;STRONG&gt;103,&lt;/STRONG&gt; &lt;STRONG&gt;145, 146), &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: black; font-size: 10pt; font-family: Calibri;"&gt;Pick(Match(Response,'Yes','No'),'No','Yes'),Response)&lt;/STRONG&gt;&lt;SPAN style="color: black; font-size: 10pt; font-family: Calibri;"&gt; &lt;STRONG&gt;as&lt;/STRONG&gt; &lt;STRONG&gt;Response&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;,Rating&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;,[STED Category]&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;FROM&lt;/STRONG&gt; &lt;STRONG&gt;[STED].[dbo].[Answers]&lt;/STRONG&gt; &lt;STRONG&gt;A&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;LEFT&lt;/STRONG&gt; &lt;STRONG&gt;JOIN&lt;/STRONG&gt; &lt;STRONG&gt;[STED].[dbo].[Questions]&lt;/STRONG&gt; &lt;STRONG&gt;C&lt;/STRONG&gt; &lt;STRONG&gt;on&lt;/STRONG&gt; &lt;STRONG&gt;A.QuestionNumber=C.[Question_Number]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;This worked in excel where all the data is in single spread sheet and we have 1 field for Question Number. However in the SQL table, the data is split into two tables so I had to join Table A and Table C. I have a strong feeling that because it is based on the question number, Table A has the column header as 'QuestionNumber' and column C has 'Question_Number. Is this what is causing the problem, and is there a workaround for this please?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;Thanks &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 16:07:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899873#M993122</guid>
      <dc:creator>infock12</dc:creator>
      <dc:date>2015-07-17T16:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: IF MATCH IN JOINED SQL TABLES</title>
      <link>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899874#M993123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think that the join is a problem but you could load these tables as single tables and make the join in qv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what didn't worked are the pick(match()) within the sql then this are qv functions. For this you need a preceeding load like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 10pt; font-family: Calibri;"&gt;&lt;STRONG&gt;IF(Match(QuestionNumber,&lt;/STRONG&gt; &lt;STRONG&gt;25,&lt;/STRONG&gt; &lt;STRONG&gt;38,&lt;/STRONG&gt; &lt;STRONG&gt;83,&lt;/STRONG&gt; &lt;STRONG&gt;103,&lt;/STRONG&gt; &lt;STRONG&gt;145, 146), &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: Calibri;"&gt;Pick(Match(Response,'Yes','No'),'No','Yes'),Response)&lt;/STRONG&gt;&lt;SPAN style="color: black; font-size: 10pt; font-family: Calibri;"&gt; &lt;STRONG&gt;as&lt;/STRONG&gt; &lt;STRONG&gt;Response;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 10pt; font-family: Calibri;"&gt;SELECT&lt;/STRONG&gt;&lt;SPAN style="color: black; font-size: 10pt; font-family: Calibri;"&gt; &lt;STRONG&gt;[QuestionNumber]&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;,C.Question&lt;/STRONG&gt; &lt;STRONG&gt;as&lt;/STRONG&gt; &lt;STRONG&gt;Questions&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;,Response&lt;/STRONG&gt; &lt;STRONG&gt;as&lt;/STRONG&gt; &lt;STRONG&gt;OriginalResponse&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;,QuestionNumber&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;,Rating&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;,[STED Category]&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;FROM&lt;/STRONG&gt; &lt;STRONG&gt;[STED].[dbo].[Answers]&lt;/STRONG&gt; &lt;STRONG&gt;A&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;LEFT&lt;/STRONG&gt; &lt;STRONG&gt;JOIN&lt;/STRONG&gt; &lt;STRONG&gt;[STED].[dbo].[Questions]&lt;/STRONG&gt; &lt;STRONG&gt;C&lt;/STRONG&gt; &lt;STRONG&gt;on&lt;/STRONG&gt; &lt;STRONG&gt;A.QuestionNumber=C.[Question_Number]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also: &lt;A href="https://community.qlik.com/qlik-blogpost/2972"&gt;Preceding Load&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 16:31:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899874#M993123</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-07-17T16:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: IF MATCH IN JOINED SQL TABLES</title>
      <link>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899875#M993124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;‌Thanks Marcus. I will try that and let you know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 16:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899875#M993124</guid>
      <dc:creator>infock12</dc:creator>
      <dc:date>2015-07-17T16:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: IF MATCH IN JOINED SQL TABLES</title>
      <link>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899876#M993125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;I tried but I am getting an error message saying&amp;nbsp;Field No Found &lt;/P&gt;&lt;P&gt;The script is below: I have added a comma after the first Load&amp;nbsp;*&amp;nbsp;and added the table name "Questions" after the first Load statement. .other than that, it is exactly the same&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;IF(Match(QuestionNumber, 25, 83, 103,145, 146),Pick(Match(Response,'Yes','No'),'No','Yes'), Response) as Response;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;SELECT QuestionNumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Questions,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response as OriginalResponse,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rating,&lt;/P&gt;&lt;P&gt;FROM .[dbo].[Answers] A&lt;/P&gt;&lt;P&gt;LEFT JOIN .[dbo].[Questions] C on A.QuestionNumber=C.[Question_Number]&amp;nbsp;Is there any Syntax that is going wrong please or not putting the right thing at the right place?&lt;/P&gt;&lt;P&gt;&amp;nbsp;      From: Marcus Sommer &amp;lt;qcwebmaster@qlikview.com&amp;gt;&lt;/P&gt;&lt;P&gt; To: Karthik Chinnas &amp;lt;karthik.chinnasamy@yahoo.com&amp;gt; &lt;/P&gt;&lt;P&gt; Sent: Friday, 17 July 2015, 17:32&lt;/P&gt;&lt;P&gt; Subject: Re:  - IF MATCH IN JOINED SQL TABLES&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;|  &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;| &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF MATCH IN JOINED SQL TABLES&lt;/P&gt;&lt;P&gt;reply from Marcus Sommer in New to QlikView - View the full discussionI don't think that the join is a problem but you could load these tables as single tables and make the join in qv.&amp;nbsp;But what didn't worked are the pick(match()) within the sql then this are qv functions. For this you need a preceeding load like:&amp;nbsp;Load *IF(Match(QuestionNumber, 25, 38, 83, 103, 145, 146), Pick(Match(Response,'Yes','No'),'No','Yes'),Response) as Response;&amp;nbsp;SELECT &lt;/P&gt;&lt;P&gt; ,C.Question as Questions&lt;/P&gt;&lt;P&gt; ,Response as OriginalResponse&lt;/P&gt;&lt;P&gt; ,QuestionNumber&lt;/P&gt;&lt;P&gt; ,Rating&lt;/P&gt;&lt;P&gt; ,[STED Category]&lt;/P&gt;&lt;P&gt; FROM .[dbo].[Answers] A&lt;/P&gt;&lt;P&gt; LEFT JOIN .[dbo].[Questions] C on A.QuestionNumber=C.[Question_Number]&amp;nbsp;See also: Preceding Load&amp;nbsp;- Marcus&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Reply to this message by replying to this email, or go to the message on Qlik Community&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;|  Start a new discussion in New to QlikView by email or at Qlik Community  &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Following IF MATCH IN JOINED SQL TABLES in these streams: Inbox&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   © 1993-2015 QlikTech International AB |  Copyright &amp;amp; Trademarks | Privacy | Terms of Use | Software EULA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:26:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899876#M993125</guid>
      <dc:creator>infock12</dc:creator>
      <dc:date>2015-07-17T18:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: IF MATCH IN JOINED SQL TABLES</title>
      <link>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899877#M993126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You changed field Response as OriginalResponse in SELECT and using Response in LOAD statement. Use OriginalResponse instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;KKR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:32:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899877#M993126</guid>
      <dc:creator />
      <dc:date>2015-07-17T18:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: IF MATCH IN JOINED SQL TABLES</title>
      <link>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899878#M993127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;‌Thanks KKR. I tried both but it didn't work. The error message I am getting for both is Field Not Found &amp;lt;Response&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:38:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899878#M993127</guid>
      <dc:creator>infock12</dc:creator>
      <dc:date>2015-07-17T18:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: IF MATCH IN JOINED SQL TABLES</title>
      <link>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899879#M993128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(Match(QuestionNumber, 25, 83, 103,145, 146),Pick(Match(OriginalResponse,'Yes','No'),'No','Yes'), OriginalResponse) as Response;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT QuestionNumber,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Questions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response as OriginalResponse,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rating,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM .[dbo].[Answers] A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN .[dbo].[Questions] C on A.QuestionNumber=C.[Question_Number] ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope there is a Response field in your sql query&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:56:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899879#M993128</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-07-17T18:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: IF MATCH IN JOINED SQL TABLES</title>
      <link>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899880#M993129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sasidhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked, thank you very much! Not sure why it didn't work before, I tried all different options. Perhaps I might have done something wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:16:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899880#M993129</guid>
      <dc:creator>infock12</dc:creator>
      <dc:date>2015-07-17T19:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: IF MATCH IN JOINED SQL TABLES</title>
      <link>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899881#M993130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great,please clise the thread by marking a correct answer. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:21:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-MATCH-IN-JOINED-SQL-TABLES/m-p/899881#M993130</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-07-17T19:21:01Z</dc:date>
    </item>
  </channel>
</rss>

