<?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 Replicate SQL queries to QlikView Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147975#M26343</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shumail,&lt;BR /&gt;I think my queries should work correctly (if I understood the requirements), and can't see why the result is different. There is no way I can tell what is different without the direct access to your database, and trying myslef. Since it is not possible, you probably need an involved assistance from QlikTech consultants at your location. Sorry about that.&lt;BR /&gt;I'm thinking, if you're confident in the SQL queries results - why don't you use them as is in your QV script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jun 2009 03:40:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-06-30T03:40:31Z</dc:date>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147970#M26338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to replicate below SQL queries to my QlikView project but the result i am getting is not reconciling.. Can anyone please help? OR can we use left outer / keep on Load statment?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;B&gt;SQL Query 4&lt;/B&gt;&lt;BR /&gt;SELECT s2.BASE_SEGMENT_NBR, max(s2.[card_no]) as card_no, s2.Mid_14, max(s2.Replacement) as Replacement&lt;BR /&gt;FROM vwActiveCard_Step2 s2&lt;BR /&gt;left outer join vwActiveCard_Step3 s3 on s2.BASE_SEGMENT_NBR = s3.BASE_SEGMENT_NBR and s2.mid_14 = s3.mid_14&lt;BR /&gt;where s3.BASE_SEGMENT_NBR is null and s3.card_no is null group by s2.BASE_SEGMENT_NBR, s2.Mid_14&lt;BR /&gt;&lt;B&gt;QV Script&lt;/B&gt;&lt;BR /&gt;V4:&lt;BR /&gt;LOAD Max(CARD_NO) as CARD_NO,'P' as V4, Max(LoadDate_V2) as LoadDate_V4, Max(CARD_NO) as CARD4, BASE_SEGMENT_NBR2 as BASE_SEGMENT_NBR4&lt;BR /&gt;, Mid_14_2 AS Mid_14_4, Max(Replacement2) AS Replacement4&lt;BR /&gt;RESIDENT V2&lt;BR /&gt;WHERE&lt;BR /&gt;not Exists(BASE_SEGMENT_NBR2, BASE_SEGMENT_NBR3) and&lt;BR /&gt;not Exists(Mid_14_2, Mid_14_3)&lt;BR /&gt;group by BASE_SEGMENT_NBR2, Mid_14_2;&lt;BR /&gt;&lt;B&gt;SQL Query 5&lt;/B&gt;&lt;BR /&gt;SELECT S4.BASE_SEGMENT_NBR, S2.CARD_NO--, S2.[BlockCode1], S2.[BlockCode2], S2.[BlockCode3], S2.[CUR_BAL], S2.Replacement&lt;BR /&gt;FROM vwActiveCard_Step4 S4&lt;BR /&gt;LEFT OUTER JOIN vwActiveCard_Step2 S2 ON (S4.BASE_SEGMENT_NBR = S2.BASE_SEGMENT_NBR AND S4.Mid_14 = S2.Mid_14 AND S4.Replacement = S2.Replacement)&lt;BR /&gt;&lt;B&gt;QV Script&lt;/B&gt;&lt;BR /&gt;V5:&lt;BR /&gt;LOAD CARD_NO,'P' as V5,LoadDate_V4 as LoadDate_V5,CARD_NO as CARD5, BASE_SEGMENT_NBR4 as BASE_SEGMENT_NBR5&lt;BR /&gt;, Mid_14_4 AS Mid_14_5, Replacement4 AS Replacement5&lt;BR /&gt;RESIDENT V4&lt;BR /&gt;WHERE Exists(BASE_SEGMENT_NBR2, BASE_SEGMENT_NBR4) and Exists(Mid_14_2, Mid_14_4) and Exists(Replacement2, Replacement4);&lt;B&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/B&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;for more detail&lt;/P&gt;&lt;P&gt;Reference: http://community.qlik.com/forums/p/17422/68208.aspx#68208&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jun 2009 22:49:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147970#M26338</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-06-28T22:49:33Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147971#M26339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shumail,&lt;BR /&gt;&lt;BR /&gt;Query 4.&lt;BR /&gt;What bothers me in this SQL query is that you're joining on&lt;BR /&gt;&lt;B&gt;s2.BASE_SEGMENT_NBR = s3.BASE_SEGMENT_NBR&lt;/B&gt;&lt;BR /&gt;and, at the same time using the condition&lt;BR /&gt;&lt;B&gt;s3.BASE_SEGMENT_NBR is null&lt;/B&gt;&lt;BR /&gt;I'm not sure if it does any good. Does this SQL returns the same result?&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;SELECT&lt;BR /&gt; s2.BASE_SEGMENT_NBR,&lt;BR /&gt; max(s2.[card_no]) as card_no,&lt;BR /&gt; s2.Mid_14,&lt;BR /&gt; max(s2.Replacement) as Replacement&lt;BR /&gt;FROM vwActiveCard_Step2 s2&lt;BR /&gt;left outer join vwActiveCard_Step3 s3 on s2.mid_14 = s3.mid_14&lt;BR /&gt;where s3.BASE_SEGMENT_NBR is null&lt;BR /&gt; and s3.card_no is null&lt;BR /&gt;group by s2.BASE_SEGMENT_NBR, s2.Mid_14&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Anyway, I think you can use inner join here. This is how the LOAD may look like (that is, if I undestand the logic behind it, and your naming conventions):&lt;BR /&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;V4:&lt;BR /&gt;LOAD&lt;BR /&gt; Max(CARD_NO) as CARD_NO,&lt;BR /&gt; 'P' as V4,&lt;BR /&gt; Max(LoadDate_V2) as LoadDate_V4,&lt;BR /&gt; Max(CARD_NO) as CARD4,&lt;BR /&gt; BASE_SEGMENT_NBR2 as BASE_SEGMENT_NBR4,&lt;BR /&gt; Mid_14_2 AS Mid_14_4,&lt;BR /&gt; Max(Replacement2) AS Replacement4&lt;BR /&gt;RESIDENT V2&lt;BR /&gt;GROUP BY BASE_SEGMENT_NBR2, Mid_14_2;&lt;BR /&gt;INNER JOIN (V4) LOAD&lt;BR /&gt; BASE_SEGMENT_NBR3 as BASE_SEGMENT_NBR4,&lt;BR /&gt; Mid_14_3 as Mid_14_4&lt;BR /&gt;RESIDENT V3&lt;BR /&gt;WHERE len(trim(CARD3))=0; // or is it CARD_NO here? You know better...&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Query 5:&lt;BR /&gt;Looks OK, again, if I understand the logic, but you can use inner join as well:&lt;BR /&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;V5:&lt;BR /&gt; LOAD CARD_NO,&lt;BR /&gt; 'P' as V5,&lt;BR /&gt; LoadDate_V4 as LoadDate_V5,&lt;BR /&gt; CARD_NO as CARD5,&lt;BR /&gt; BASE_SEGMENT_NBR4 as BASE_SEGMENT_NBR5,&lt;BR /&gt; Mid_14_4 AS Mid_14_5,&lt;BR /&gt; Replacement4 AS Replacement5&lt;BR /&gt;RESIDENT V4;&lt;BR /&gt;INNER JOIN (V4) LOAD&lt;BR /&gt; BASE_SEGMENT_NBR2 as BASE_SEGMENT_NBR5,&lt;BR /&gt; Mid_14_2 as Mid_14_4,&lt;BR /&gt; Replacement2 as Replacement4&lt;BR /&gt;RESIDENT V2;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 01:15:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147971#M26339</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-29T01:15:09Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147972#M26340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;In query 4 I am doing cross join by using left outer join and getting all the rows which are not matching in view 3.&lt;/P&gt;&lt;P&gt;I am not getting the same rows as in sql query FOR Q4 &amp;amp; Q5. I have tried your join query in the below pattern but still i am not getting the same result as in SQL Server. &lt;IMG alt="Tongue Tied" src="http://community.qlik.com/emoticons/emotion-7.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;V4:&lt;BR /&gt;LOAD&lt;BR /&gt; Max(CARD_NO) as CARD_NO,&lt;BR /&gt; 'P' as V4,&lt;BR /&gt; Max(LoadDate_V2) as LoadDate_V4,&lt;BR /&gt; Max(CARD_NO) as CARD4,&lt;BR /&gt; BASE_SEGMENT_NBR2 as BASE_SEGMENT_NBR4,&lt;BR /&gt; Mid_14_2 AS Mid_14_4,&lt;BR /&gt; Max(Replacement2) AS Replacement4&lt;BR /&gt;RESIDENT V2&lt;BR /&gt;GROUP BY BASE_SEGMENT_NBR2, Mid_14_2;&lt;BR /&gt;left outer JOIN (V4) LOAD&lt;BR /&gt; BASE_SEGMENT_NBR3 as BASE_SEGMENT_NBR4,&lt;BR /&gt; Mid_14_3 as Mid_14_4&lt;BR /&gt;RESIDENT V3&lt;BR /&gt;WHERE not exists(CARD3, CARD2);&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;whereas query 5 is all dependent on the result of query 4 so i need to resolve query 4 first. can you please help that what would be the other possible way to do it so that my numbers has been reconcile.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 19:33:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147972#M26340</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-06-29T19:33:22Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147973#M26341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But you're using left outer join istead of inner join...&lt;BR /&gt;And, not exists(CARS3, CARD2) is not the same isnull(CARD3).&lt;BR /&gt;Try it the way I posted earlier.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 23:45:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147973#M26341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-29T23:45:00Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147974#M26342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried ur aswell but i am not getting the same result as i have in SQL Server. :S&lt;/P&gt;&lt;P&gt;Can you review all the 5 queries from the link http://community.qlik.com/forums/p/17422/68208.aspx#68208............ May be we can optimize view# 4 &amp;amp; 5 and can rewrite the sql / qvw script for that.??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 00:43:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147974#M26342</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-06-30T00:43:06Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147975#M26343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shumail,&lt;BR /&gt;I think my queries should work correctly (if I understood the requirements), and can't see why the result is different. There is no way I can tell what is different without the direct access to your database, and trying myslef. Since it is not possible, you probably need an involved assistance from QlikTech consultants at your location. Sorry about that.&lt;BR /&gt;I'm thinking, if you're confident in the SQL queries results - why don't you use them as is in your QV script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 03:40:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147975#M26343</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-30T03:40:31Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147976#M26344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to develop this project standalone without any integration with SQL Server database. means i need to perform ETL from text file as we dont have SQL Server on Production due to company policies.&lt;/P&gt;&lt;P&gt;Thanks for support Michael, I will try to contact Qlikview consultant for more support.&lt;/P&gt;&lt;P&gt;Tell me is there anyway that I can upload my large sample QlikView file for the reconciliation?&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Shumail&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 03:46:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147976#M26344</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-06-30T03:46:59Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147977#M26345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for you - load from text file is slow, from my experience, and it's harder to implement more or less complex logic. &lt;IMG alt="Sad" src="http://community.qlik.com/emoticons/emotion-6.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 03:49:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147977#M26345</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-30T03:49:40Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147978#M26346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tell me is there anyway that I can upload my large sample QlikView file for the reconciliation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 03:52:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147978#M26346</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-06-30T03:52:16Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147979#M26347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;if you have seen the snap shot i have posted yesterday as above then the required result for query 4 is 6,333 records but i am getting 29,449 in qlikview already raised. I have tried to obtain the same result in sql which was not required but i got it successfully, below is the query FYR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;BR /&gt;V4:&lt;BR /&gt;LOAD&lt;BR /&gt; Max(CARD_NO) as CARD_NO, 'P' as V4, Max(LoadDate_V2) as LoadDate_V4, Max(CARD2) as CARD4,&lt;BR /&gt; BASE_SEGMENT_NBR2 as BASE_SEGMENT_NBR4,&lt;BR /&gt; Mid_14_2 AS Mid_14_4,&lt;BR /&gt; Max(Replacement2) AS Replacement4&lt;BR /&gt;RESIDENT V2&lt;BR /&gt;GROUP BY BASE_SEGMENT_NBR2, Mid_14_2;&lt;BR /&gt;left JOIN (V4) LOAD&lt;BR /&gt; BASE_SEGMENT_NBR3 as BASE_SEGMENT_NBR4,&lt;BR /&gt; Mid_14_3 as Mid_14_4 //, COUNT(CARD_NO) AS NOOFCARD&lt;BR /&gt;RESIDENT V3&lt;BR /&gt;WHERE not exists(BASE_SEGMENT_NBR2, BASE_SEGMENT_NBR3) AND not exists(CARD2, CARD3)&lt;BR /&gt;&lt;BR /&gt;select&lt;BR /&gt; Max(s2.CARD_NO) as CARD_NO,&lt;BR /&gt; 'P' as V4,&lt;BR /&gt; Max(s2.CARD_NO) as CARD4,&lt;BR /&gt; s2.BASE_SEGMENT_NBR as BASE_SEGMENT_NBR,&lt;BR /&gt; s2.Mid_14 AS Mid_14_4,&lt;BR /&gt; Max(s2.Replacement) AS Replacement4&lt;BR /&gt;from vwActiveCard_Step2 s2&lt;BR /&gt;GROUP BY s2.BASE_SEGMENT_NBR, s2.Mid_14;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Still i couldnt figure out how to replicate the required sql statement in qlikview as i raised earlier &lt;IMG alt="Tongue Tied" src="http://community.qlik.com/emoticons/emotion-7.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 21:48:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147979#M26347</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-06-30T21:48:15Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147980#M26348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shumail,&lt;BR /&gt;Are you getting the correct result in V4 now? The logic in the load script and in SQL queries looks different. Maybe "replicate" should not be the puropse after all?&lt;BR /&gt;(I'll try to take a closer look when I get time. It's not a 15-min answer...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 23:41:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147980#M26348</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-30T23:41:35Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147981#M26349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;still not &lt;IMG alt="Sad" src="http://community.qlik.com/emoticons/emotion-6.gif" /&gt;&lt;/P&gt;&lt;P&gt;Below are the queries which i have created. My objective is to get 6,333 records from V4 but i am getting 29,449 records. I have created another query from which i am getting 23,116 records. If you subtract both number of records then i can get 6,333 records which i require. &lt;IMG alt="Idea" src="http://community.qlik.com/emoticons/emotion-55.gif" /&gt;&lt;/P&gt;&lt;P&gt;Can you please help me in the below query that how can i subtract V4 and V6 and get 6,333 records? I tried not exists function but its not working &lt;IMG alt="Indifferent" src="http://community.qlik.com/emoticons/emotion-8.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;V4:&lt;BR /&gt;LOAD&lt;BR /&gt; Max(CARD_NO) as CARD_NO,&lt;BR /&gt; 'P' as V4,&lt;BR /&gt; Max(LoadDate_V2) as LoadDate_V4,&lt;BR /&gt; Max(CARD2) as CARD4,&lt;BR /&gt; BASE_SEGMENT_NBR2 as BASE_SEGMENT_NBR4,&lt;BR /&gt; Mid_14_2 AS Mid_14_4,&lt;BR /&gt; Max(Replacement2) AS Replacement4&lt;BR /&gt;RESIDENT V2&lt;BR /&gt;GROUP BY BASE_SEGMENT_NBR2, Mid_14_2;&lt;BR /&gt;left JOIN (V4) LOAD&lt;BR /&gt; BASE_SEGMENT_NBR3 as BASE_SEGMENT_NBR4,&lt;BR /&gt; Mid_14_3 as Mid_14_4&lt;BR /&gt;RESIDENT V3&lt;BR /&gt;WHERE not exists(BASE_SEGMENT_NBR2, BASE_SEGMENT_NBR3) AND not exists(CARD2, CARD3);&lt;BR /&gt;&lt;BR /&gt;V6:&lt;BR /&gt;LOAD&lt;BR /&gt; Max(CARD_NO) as CARD_NO,&lt;BR /&gt; 'P' as V6,&lt;BR /&gt; Max(LoadDate_V2) as LoadDate_V6,&lt;BR /&gt; Max(CARD2) as CARD6,&lt;BR /&gt; BASE_SEGMENT_NBR2 as BASE_SEGMENT_NBR6,&lt;BR /&gt; Mid_14_2 AS Mid_14_6,&lt;BR /&gt; Max(Replacement2) AS Replacement6&lt;BR /&gt;RESIDENT V2&lt;BR /&gt;GROUP BY BASE_SEGMENT_NBR2, Mid_14_2;&lt;BR /&gt;inner JOIN (V6) LOAD&lt;BR /&gt; BASE_SEGMENT_NBR3 as BASE_SEGMENT_NBR6,&lt;BR /&gt; Mid_14_3 as Mid_14_6&lt;BR /&gt;RESIDENT V3;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 00:03:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147981#M26349</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-07-01T00:03:59Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147982#M26350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is interesting. It must be "not exists". The quesion is - what the correct parameters are. What is the primary ID of the record? Is it BASE_SEGMENT_NBRn? If yes:&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;V41:&lt;BR /&gt;LOAD&lt;BR /&gt;...&lt;BR /&gt;RESIDENT V4&lt;BR /&gt;WHERE not exists(BASE_SEGMENT_NBR6, BASE_SEGMENT_NBR4)&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 02:49:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147982#M26350</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-07-01T02:49:04Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147983#M26351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Michael,&lt;/P&gt;&lt;P&gt;It's done, I had broken query 4 in 2 queries as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;V6:&lt;BR /&gt;LOAD&lt;BR /&gt; Max(CARD_NO) as CARD_NO,&lt;BR /&gt; 'P' as V4,&lt;BR /&gt; Max(LoadDate_V2) as LoadDate_V6,&lt;BR /&gt; Max(CARD2) as CARD6,&lt;BR /&gt; BASE_SEGMENT_NBR2 as BASE_SEGMENT_NBR6,&lt;BR /&gt; Mid_14_2 AS Mid_14_6,&lt;BR /&gt; Max(Replacement2) AS Replacement6&lt;BR /&gt;RESIDENT V2&lt;BR /&gt;GROUP BY BASE_SEGMENT_NBR2, Mid_14_2;&lt;BR /&gt;LEFT JOIN (V4) LOAD&lt;BR /&gt; BASE_SEGMENT_NBR3 as BASE_SEGMENT_NBR6,&lt;BR /&gt; Mid_14_3 as Mid_14_6&lt;BR /&gt;RESIDENT V3;&lt;BR /&gt;&lt;BR /&gt;V4:&lt;BR /&gt;LOAD CARD_NO,'P' as V4,LoadDate_V6 as LoadDate_V4, CARD_NO as CARD4, BASE_SEGMENT_NBR6 AS BASE_SEGMENT_NBR4&lt;BR /&gt;, Mid_14_6 as Mid_14_4, Replacement6 as Replacement4&lt;BR /&gt;RESIDENT V6&lt;BR /&gt;WHERE NOT Exists(Mid_14_3, Mid_14_6);&lt;BR /&gt;&lt;BR /&gt;drop table V6;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I still not able to learn the way to write load statement perfectly. Neways whatever it is but i am getting my result.&lt;/P&gt;&lt;P&gt;Thanks Michael for the great support.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;&lt;I&gt;&lt;B&gt;Shumail Hussain&lt;/B&gt;&lt;/I&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 12:06:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147983#M26351</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-07-01T12:06:36Z</dc:date>
    </item>
    <item>
      <title>Replicate SQL queries to QlikView Script</title>
      <link>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147984#M26352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great!&lt;BR /&gt;(Sometimes there is no "perfect" solution, especailly when you don't have access to the database.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 23:02:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replicate-SQL-queries-to-QlikView-Script/m-p/147984#M26352</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-07-01T23:02:59Z</dc:date>
    </item>
  </channel>
</rss>

