<?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 Exluding records from a primary table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147482#M716860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With some minor assumptions about your data - all BLOCK fields are a single character, there is only one row per CARD_NO - I get this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;V3:&lt;BR /&gt;LOAD CARD_NO,'P' as V3,LoadDate as LoadDate_V3&lt;BR /&gt;RESIDENT $(CurrentFileName)&lt;BR /&gt;WHERE NOT ( match('R',BLOCK1,BLOCK2,BLOCK3)&lt;BR /&gt; OR ( round(num#(CUR_BAL))&amp;lt;=0&lt;BR /&gt; AND ( index(BLOCK1,'UVWDGLFX')&lt;BR /&gt; OR index(BLOCK2,'UVWDGLFX')&lt;BR /&gt; OR index(BLOCK3,'UVWDGLFX'))))&lt;BR /&gt; AND NOT ( num#(CUR_BAL)&amp;lt;&amp;gt;0&lt;BR /&gt; AND ( ( index(BLOCK1,'LF')&lt;BR /&gt; AND index(BLOCK2,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK3,'ACDFGILNOPQTUVWXZ '))&lt;BR /&gt; OR ( index(BLOCK1,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK2,'LF')&lt;BR /&gt; AND index(BLOCK3,'ACDFGILNOPQTUVWXZ '))&lt;BR /&gt; OR ( index(BLOCK1,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK2,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK3,'LF'))));&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Edit: Oh, you probably meant to keep the V1 and V2 tables. In that case, something more like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;V1:&lt;BR /&gt;LOAD CARD_NO,'P' as V1,LoadDate as LoadDate_V1,CARD_NO as CARD&lt;BR /&gt;RESIDENT $(CurrentFileName)&lt;BR /&gt;WHERE match('R',BLOCK1,BLOCK2,BLOCK3)&lt;BR /&gt; OR ( round(num#(CUR_BAL))&amp;lt;=0&lt;BR /&gt; AND ( index(BLOCK1,'UVWDGLFX')&lt;BR /&gt; OR index(BLOCK2,'UVWDGLFX')&lt;BR /&gt; OR index(BLOCK3,'UVWDGLFX')))&lt;BR /&gt;;&lt;BR /&gt;V2:&lt;BR /&gt;LOAD CARD_NO,'P' as V2,LoadDate as LoadDate_V2,CARD_NO as CARD&lt;BR /&gt;RESIDENT $(CurrentFileName)&lt;BR /&gt;WHERE num#(CUR_BAL)&amp;lt;&amp;gt;0&lt;BR /&gt; AND ( ( index(BLOCK1,'LF')&lt;BR /&gt; AND index(BLOCK2,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK3,'ACDFGILNOPQTUVWXZ '))&lt;BR /&gt; OR ( index(BLOCK1,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK2,'LF')&lt;BR /&gt; AND index(BLOCK3,'ACDFGILNOPQTUVWXZ '))&lt;BR /&gt; OR ( index(BLOCK1,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK2,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK3,'LF')))&lt;BR /&gt;;&lt;BR /&gt;V3:&lt;BR /&gt;LOAD CARD_NO,'P' as V3,LoadDate as LoadDate_V3&lt;BR /&gt;RESIDENT $(CurrentFileName)&lt;BR /&gt;WHERE NOT EXITS(CARD,CARD_NO)&lt;BR /&gt;;&lt;BR /&gt;DROP FIELD CARD&lt;BR /&gt;;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jun 2009 01:41:38 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2009-06-23T01:41:38Z</dc:date>
    <item>
      <title>Exluding records from a primary table</title>
      <link>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147481#M716859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to parse my data on scripting environment of Qlikview but i am not sure about the validity of the resultant of the below code. plus i feel the code i am doing is not optimized or there will be a more efficient way to write below.&lt;/P&gt;&lt;P&gt;Can any one please help and let me know either the table V3 would provide me the valid data by using the inner join clause OR Is there any other way to exclude records from the primary table i.e. $(CurrentFileName)?&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;$(V1):&lt;BR /&gt;Load CARD_NO, 'P' as V1, LoadDate as LoadDate_V1 resident $(CurrentFileName)&lt;BR /&gt;WHERE (&lt;BR /&gt;(MATCH(BLOCK1,'U','V','W','D','G','L','R','F','X') AND Round(Num#(CUR_BAL)) &amp;lt;= 0) OR&lt;BR /&gt;(MATCH(BLOCK2,'U','V','W','D','G','L','R','F','X') AND Round(Num#(CUR_BAL)) &amp;lt;= 0) OR&lt;BR /&gt;(MATCH(BLOCK3,'U','V','W','D','G','L','R','F','X') AND Round(Num#(CUR_BAL)) &amp;lt;= 0)&lt;BR /&gt;) OR (BLOCK1 = 'R' OR BLOCK2 = 'R' OR BLOCK3 = 'R');&lt;BR /&gt;&lt;BR /&gt;//*********************************************************************************************************************************&lt;BR /&gt;&lt;BR /&gt;$(V2):&lt;BR /&gt;Load CARD_NO, 'P' as V2, LoadDate as LoadDate_V2 resident $(CurrentFileName)&lt;BR /&gt;WHERE&lt;BR /&gt;(&lt;BR /&gt; (&lt;BR /&gt; BLOCK1='L' Or BLOCK1='F'&lt;BR /&gt; ) AND&lt;BR /&gt; (&lt;BR /&gt; Match(BLOCK2 ,'A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z', '') OR&lt;BR /&gt; (trim(BLOCK2) = '')&lt;BR /&gt; ) AND&lt;BR /&gt; (&lt;BR /&gt; (trim(BLOCK3) ='') OR&lt;BR /&gt; Match(BLOCK3 ,'A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z', '' )&lt;BR /&gt; ) AND&lt;BR /&gt; (&lt;BR /&gt; NUM#(CUR_BAL) &amp;lt;&amp;gt; 0&lt;BR /&gt; )&lt;BR /&gt;) OR&lt;BR /&gt;(&lt;BR /&gt; (&lt;BR /&gt; BLOCK2='L' Or BLOCK2='F'&lt;BR /&gt; ) AND&lt;BR /&gt; (&lt;BR /&gt; Match(BLOCK1 ,'A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z', '') OR&lt;BR /&gt; (trim(BLOCK1) = '')&lt;BR /&gt; ) AND&lt;BR /&gt; (&lt;BR /&gt; (trim(BLOCK3) ='') OR&lt;BR /&gt; Match(BLOCK3 ,'A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z', '' )&lt;BR /&gt; ) AND&lt;BR /&gt; (&lt;BR /&gt; NUM#(CUR_BAL) &amp;lt;&amp;gt; 0&lt;BR /&gt; )&lt;BR /&gt;) OR&lt;BR /&gt;(&lt;BR /&gt; (&lt;BR /&gt; BLOCK3='L' Or BLOCK3='F'&lt;BR /&gt; ) AND&lt;BR /&gt; (&lt;BR /&gt; Match(BLOCK1 ,'A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z', '') OR&lt;BR /&gt; (trim(BLOCK1) = '')&lt;BR /&gt; ) AND&lt;BR /&gt; (&lt;BR /&gt; (trim(BLOCK2) ='') OR&lt;BR /&gt; Match(BLOCK2 ,'A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z', '' )&lt;BR /&gt; ) AND&lt;BR /&gt; (&lt;BR /&gt; NUM#(CUR_BAL) &amp;lt;&amp;gt; 0&lt;BR /&gt; )&lt;BR /&gt;)&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$(V3):&lt;BR /&gt;Load CARD_NO, 'P' as V3, LoadDate as LoadDate_V3 resident $(CurrentFileName);&lt;BR /&gt;&lt;BR /&gt;inner join&lt;BR /&gt;Load CARD_NO resident V1&lt;BR /&gt;where NOT exists(CARD_NO);&lt;BR /&gt;&lt;BR /&gt;inner join&lt;BR /&gt;Load CARD_NO resident V2&lt;BR /&gt;where NOT exists(CARD_NO);&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 00:20:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147481#M716859</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-06-23T00:20:23Z</dc:date>
    </item>
    <item>
      <title>Exluding records from a primary table</title>
      <link>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147482#M716860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With some minor assumptions about your data - all BLOCK fields are a single character, there is only one row per CARD_NO - I get this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;V3:&lt;BR /&gt;LOAD CARD_NO,'P' as V3,LoadDate as LoadDate_V3&lt;BR /&gt;RESIDENT $(CurrentFileName)&lt;BR /&gt;WHERE NOT ( match('R',BLOCK1,BLOCK2,BLOCK3)&lt;BR /&gt; OR ( round(num#(CUR_BAL))&amp;lt;=0&lt;BR /&gt; AND ( index(BLOCK1,'UVWDGLFX')&lt;BR /&gt; OR index(BLOCK2,'UVWDGLFX')&lt;BR /&gt; OR index(BLOCK3,'UVWDGLFX'))))&lt;BR /&gt; AND NOT ( num#(CUR_BAL)&amp;lt;&amp;gt;0&lt;BR /&gt; AND ( ( index(BLOCK1,'LF')&lt;BR /&gt; AND index(BLOCK2,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK3,'ACDFGILNOPQTUVWXZ '))&lt;BR /&gt; OR ( index(BLOCK1,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK2,'LF')&lt;BR /&gt; AND index(BLOCK3,'ACDFGILNOPQTUVWXZ '))&lt;BR /&gt; OR ( index(BLOCK1,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK2,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK3,'LF'))));&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Edit: Oh, you probably meant to keep the V1 and V2 tables. In that case, something more like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;V1:&lt;BR /&gt;LOAD CARD_NO,'P' as V1,LoadDate as LoadDate_V1,CARD_NO as CARD&lt;BR /&gt;RESIDENT $(CurrentFileName)&lt;BR /&gt;WHERE match('R',BLOCK1,BLOCK2,BLOCK3)&lt;BR /&gt; OR ( round(num#(CUR_BAL))&amp;lt;=0&lt;BR /&gt; AND ( index(BLOCK1,'UVWDGLFX')&lt;BR /&gt; OR index(BLOCK2,'UVWDGLFX')&lt;BR /&gt; OR index(BLOCK3,'UVWDGLFX')))&lt;BR /&gt;;&lt;BR /&gt;V2:&lt;BR /&gt;LOAD CARD_NO,'P' as V2,LoadDate as LoadDate_V2,CARD_NO as CARD&lt;BR /&gt;RESIDENT $(CurrentFileName)&lt;BR /&gt;WHERE num#(CUR_BAL)&amp;lt;&amp;gt;0&lt;BR /&gt; AND ( ( index(BLOCK1,'LF')&lt;BR /&gt; AND index(BLOCK2,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK3,'ACDFGILNOPQTUVWXZ '))&lt;BR /&gt; OR ( index(BLOCK1,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK2,'LF')&lt;BR /&gt; AND index(BLOCK3,'ACDFGILNOPQTUVWXZ '))&lt;BR /&gt; OR ( index(BLOCK1,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK2,'ACDFGILNOPQTUVWXZ ')&lt;BR /&gt; AND index(BLOCK3,'LF')))&lt;BR /&gt;;&lt;BR /&gt;V3:&lt;BR /&gt;LOAD CARD_NO,'P' as V3,LoadDate as LoadDate_V3&lt;BR /&gt;RESIDENT $(CurrentFileName)&lt;BR /&gt;WHERE NOT EXITS(CARD,CARD_NO)&lt;BR /&gt;;&lt;BR /&gt;DROP FIELD CARD&lt;BR /&gt;;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 01:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147482#M716860</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-06-23T01:41:38Z</dc:date>
    </item>
    <item>
      <title>Exluding records from a primary table</title>
      <link>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147483#M716861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Many thanks for your help, I tried the second module of code you posted, you are great. thanks&lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Shumail Hussain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 18:41:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147483#M716861</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-06-23T18:41:36Z</dc:date>
    </item>
    <item>
      <title>Exluding records from a primary table</title>
      <link>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147484#M716862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jhon!&lt;/P&gt;&lt;P&gt;Below are the sequence of (SQL Server) Views which i wanted to replicate on QlikView. These views allows us to massage the data to extract the final report. You already updated me the 3 views and i have still 2 views remaining to go to the final step.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SQL Server Views (5 Steps) and Final Query&lt;/STRONG&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;CREATE VIEW vwActiveCard_Step1&lt;BR /&gt;as&lt;BR /&gt;SELECT [Card_No] FROM cdbs&lt;BR /&gt;WHERE ( (BLOCKCODE1 In ('u','v','w','d','g','l','r','f','x') AND CUR_BAL= 0) OR&lt;BR /&gt; (BLOCKCODE2 In ('u','v','w','d','g','l','r','f','x') AND CUR_BAL= 0) OR (BLOCKCODE3 In ('u','v','w','d','g','l','r','f','x') AND CUR_BAL= 0) )&lt;BR /&gt;OR( BLOCKCODE1 = 'R' OR BLOCKCODE2 = 'R' OR BLOCKCODE3 = 'R' )&lt;BR /&gt;GO&lt;BR /&gt;CREATE VIEW vwActiveCard_Step2&lt;BR /&gt;as&lt;BR /&gt;--14&lt;BR /&gt;SELECT BASE_SEGMENT_NBR,[card_no]&lt;BR /&gt;, substring([card_no],1,17) as Mid_14, substring([card_no],18,1) as Replacement&lt;BR /&gt;FROM cdbs&lt;BR /&gt;WHERE&lt;BR /&gt;((BLOCKCODE1='L' Or BLOCKCODE1='F') AND (BLOCKCODE2 in ('A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z', '' ) OR BLOCKCODE2 IS NULL) AND (BLOCKCODE3 IS NULL OR BLOCKCODE3 in ('A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z', '' )) AND (cur_bal&amp;lt;&amp;gt;0)) OR&lt;BR /&gt;((BLOCKCODE2='L' Or BLOCKCODE2='F') AND (BLOCKCODE1 in ('A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z' , '') OR BLOCKCODE1 IS NULL) AND (BLOCKCODE3 IS NULL OR BLOCKCODE3 in ('A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z', '' )) AND (cur_bal&amp;lt;&amp;gt;0)) OR&lt;BR /&gt;((BLOCKCODE3='L' Or BLOCKCODE3='F') AND (BLOCKCODE1 in ('A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Z', '' ) OR BLOCKCODE1 IS NULL) AND (BLOCKCODE2 IS NULL OR BLOCKCODE2 in ('A' ,'C' ,'D' ,'F' ,'G' ,'I' ,'L' ,'N' ,'O' ,'P' ,'Q','T' ,'U' ,'V' ,'W' ,'X' ,'Z', '' )) AND (cur_bal&amp;lt;&amp;gt;0))&lt;BR /&gt;GO&lt;BR /&gt;CREATE VIEW vwActiveCard_Step3 as&lt;BR /&gt;SELECT --*&lt;BR /&gt;BASE_SEGMENT_NBR, F.Card_No, substring(card_no,1,17) as Mid_14,substring(card_no,18,1) as Replacement&lt;BR /&gt; FROM cdbs F&lt;BR /&gt;WHERE F.card_no NOT IN (SELECT S1.card_no FROM vwActiveCard_Step1 S1) AND&lt;BR /&gt;F.card_no NOT IN (SELECT S2.card_no FROM vwActiveCard_Step2 S2)&lt;BR /&gt;GO&lt;BR /&gt;CREATE VIEW vwActiveCard_Step4 as&lt;BR /&gt;SELECT s2.BASE_SEGMENT_NBR, max(s2.[card_no]) as card_no, s2.Mid_14, max(s2.Replacement) as Replacement --, s2.CUR_BAL&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--, s2.CUR_BAL&lt;BR /&gt;GO&lt;BR /&gt;CREATE VIEW vwActiveCard_Step5 as&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;GO&lt;BR /&gt;&lt;BR /&gt;//Final Step&lt;BR /&gt;SELECT c.*, substring(c.card_no,1,14) as Mid_14, substring(c.card_no,15,1) as Replacement, d.Bucket&lt;BR /&gt;Into [Active]&lt;BR /&gt;FROM cdbs c&lt;BR /&gt;inner JOIN Bucket d ON c.DELQ_DAYS = d.DelqDay&lt;BR /&gt;left outer JOIN vwactivecard_step1 b ON b.card_no = c.card_no&lt;BR /&gt;left outer JOIN vwactivecard_step2 a ON a.card_no = c.card_no&lt;BR /&gt;WHERE b.card_no Is Null AND a.card_no Is Null&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;STRONG&gt;below is the code which i have replicated for the QlikView, Kindly check if there's any mistake&lt;/STRONG&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;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;I&gt;V1:&lt;/I&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;LOAD&lt;/B&gt; CARD_NO,'P' &lt;B&gt;as&lt;/B&gt; V1,LoadDate &lt;B&gt;as&lt;/B&gt; LoadDate_V1,CARD_NO &lt;B&gt;as&lt;/B&gt; CARD1, BASE_SEGMENT_NBR &lt;B&gt;AS&lt;/B&gt; BASE_SEGMENT_NBR1&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;, MID(CARD_NO,1,17) &lt;B&gt;as&lt;/B&gt; Mid_14_1, MID(CARD_NO,18,1) &lt;B&gt;as&lt;/B&gt; Replacement1&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;RESIDENT&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(CurrentFileName)&lt;/I&gt;&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;WHERE&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;match('R',BLOCK1,BLOCK2,BLOCK3) &lt;B&gt;OR&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;(&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;round(CUR_BAL)=0 &lt;B&gt;AND&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;(&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;index(BLOCK1,'UVWDGLRFX') &lt;B&gt;OR&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;index(BLOCK2,'UVWDGLRFX') &lt;B&gt;OR&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;index(BLOCK3,'UVWDGLRFX')&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;)&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;)&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;I&gt;V2:&lt;/I&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;LOAD&lt;/B&gt; CARD_NO,'P' &lt;B&gt;as&lt;/B&gt; V2,LoadDate &lt;B&gt;as&lt;/B&gt; LoadDate_V2,CARD_NO &lt;B&gt;as&lt;/B&gt; CARD2, BASE_SEGMENT_NBR &lt;B&gt;AS&lt;/B&gt; BASE_SEGMENT_NBR2&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;, MID(CARD_NO,1,17) &lt;B&gt;as&lt;/B&gt; Mid_14_2, MID(CARD_NO,18,1) &lt;B&gt;as&lt;/B&gt; Replacement2&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;RESIDENT&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(CurrentFileName)&lt;/I&gt;&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;WHERE&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;round(CUR_BAL)&amp;lt;&amp;gt;0 &lt;B&gt;AND&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;(&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;(index(BLOCK1,'LF') &lt;B&gt;AND&lt;/B&gt; index(BLOCK2,'ACDFGILNOPQTUVWXZ ') &lt;B&gt;AND&lt;/B&gt; index(BLOCK3,'ACDFGILNOPQTUVWXZ ')) &lt;B&gt;OR&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;(index(BLOCK1,'ACDFGILNOPQTUVWXZ ') &lt;B&gt;AND&lt;/B&gt; index(BLOCK2,'LF') &lt;B&gt;AND&lt;/B&gt; index(BLOCK3,'ACDFGILNOPQTUVWXZ ')) &lt;B&gt;OR&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;(index(BLOCK1,'ACDFGILNOPQTUVWXZ ') &lt;B&gt;AND&lt;/B&gt; index(BLOCK2,'ACDFGILNOPQTUVWXZ ') &lt;B&gt;AND&lt;/B&gt; index(BLOCK3,'LF'))&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;);&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;I&gt;V3:&lt;/I&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;LOAD&lt;/B&gt; CARD_NO,'P' &lt;B&gt;as&lt;/B&gt; V3,LoadDate &lt;B&gt;as&lt;/B&gt; LoadDate_V3,CARD_NO &lt;B&gt;as&lt;/B&gt; CARD3, BASE_SEGMENT_NBR &lt;B&gt;AS&lt;/B&gt; BASE_SEGMENT_NBR3&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;, MID(CARD_NO,1,17) &lt;B&gt;as&lt;/B&gt; Mid_14_3, MID(CARD_NO,18,1) &lt;B&gt;as&lt;/B&gt; Replacement3&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;RESIDENT&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(CurrentFileName)&lt;/I&gt;&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;WHERE&lt;/B&gt; &lt;B&gt;NOT&lt;/B&gt; Exists(CARD1, CARD_NO) &lt;B&gt;and&lt;/B&gt; &lt;B&gt;NOT&lt;/B&gt; Exists(CARD2, CARD_NO);&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;I&gt;V4:&lt;/I&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;LOAD&lt;/B&gt; Max(CARD_NO) &lt;B&gt;as&lt;/B&gt; CARD_NO,'P' &lt;B&gt;as&lt;/B&gt; V4, Max(LoadDate_V2) &lt;B&gt;as&lt;/B&gt; LoadDate_V4, Max(CARD_NO) &lt;B&gt;as&lt;/B&gt; CARD4, BASE_SEGMENT_NBR2 &lt;B&gt;as&lt;/B&gt; BASE_SEGMENT_NBR4&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;, Mid_14_2 &lt;B&gt;AS&lt;/B&gt; Mid_14_4, Max(Replacement2) &lt;B&gt;AS&lt;/B&gt; Replacement4&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;RESIDENT&lt;/B&gt; V2&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;WHERE&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;not&lt;/B&gt; Exists(BASE_SEGMENT_NBR3, BASE_SEGMENT_NBR2) &lt;B&gt;and&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;not&lt;/B&gt; Exists(Mid_14_3, Mid_14_2)&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;group&lt;/B&gt; &lt;B&gt;by&lt;/B&gt; BASE_SEGMENT_NBR2, Mid_14_2;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;//and IsNull(BASE_SEGMENT_NBR3)= -1 and IsNull(CARD3)= -1;&lt;/B&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;I&gt;V5:&lt;/I&gt;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;LOAD&lt;/B&gt; CARD_NO,'P' &lt;B&gt;as&lt;/B&gt; V5,LoadDate_V4 &lt;B&gt;as&lt;/B&gt; LoadDate_V5,CARD_NO &lt;B&gt;as&lt;/B&gt; CARD5, BASE_SEGMENT_NBR4 &lt;B&gt;as&lt;/B&gt; BASE_SEGMENT_NBR5&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;, Mid_14_4 &lt;B&gt;AS&lt;/B&gt; Mid_14_5, Replacement4 &lt;B&gt;AS&lt;/B&gt; Replacement5&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;RESIDENT&lt;/B&gt; V4&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;WHERE&lt;/B&gt; Exists(BASE_SEGMENT_NBR2, BASE_SEGMENT_NBR4) &lt;B&gt;and&lt;/B&gt; Exists(Mid_14_2, Mid_14_4) &lt;B&gt;and&lt;/B&gt; Exists(Replacement2, Replacement4);&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;store&lt;/B&gt; V1 &lt;B&gt;into&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(Outputpath)&lt;/I&gt;&lt;/B&gt;V1.qvd ;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;store&lt;/B&gt; V2 &lt;B&gt;into&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(Outputpath)&lt;/I&gt;&lt;/B&gt;V2.qvd ;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;store&lt;/B&gt; V3 &lt;B&gt;into&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(Outputpath)&lt;/I&gt;&lt;/B&gt;V3.qvd ;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;store&lt;/B&gt; V4 &lt;B&gt;into&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(Outputpath)&lt;/I&gt;&lt;/B&gt;V3.qvd ;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;B&gt;store&lt;/B&gt; V5 &lt;B&gt;into&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(Outputpath)&lt;/I&gt;&lt;/B&gt;V3.qvd ;&lt;BR style="margin:0in 0in 0pt;line-height:normal;mso-layout-grid-align:none;" /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The Problem in the above code is that all the Load statement are not giving me the exact resultant as i am getting from SQL Server views... &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, 23 Jun 2009 21:58:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147484#M716862</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-06-23T21:58:58Z</dc:date>
    </item>
    <item>
      <title>Exluding records from a primary table</title>
      <link>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147485#M716863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Block fields contain values like 'A', 'C', 'D' etc... so for that field i have replace the code as&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;index('ACDFGILNOPQTUVWXZ ', BLOCK2)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;which has been previuosly written as &lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;index(BLOCK2,'ACDFGILNOPQTUVWXZ ')&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;and giving me no records. so now after replacement of code view 1, 2, and 3 has been reconciled. but I am still stuck with view 4 and 5. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jun 2009 22:55:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exluding-records-from-a-primary-table/m-p/147485#M716863</guid>
      <dc:creator>shumailh</dc:creator>
      <dc:date>2009-06-28T22:55:53Z</dc:date>
    </item>
  </channel>
</rss>

