<?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: Compare Loop Variable to Day(Date) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651754#M447901</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Code without Loop:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(This one works but the I have to repeat code in bold x 31 Times)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Trace Left Join Day Columns;&lt;BR /&gt;ExportFile_Future:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD Distinct&lt;BR /&gt;AEDO_transaction_id,&lt;BR /&gt;OPPS,&lt;BR /&gt;AM,&lt;BR /&gt;BFS_BRANCH_NAME,&lt;BR /&gt;EMPL_NAME,&lt;BR /&gt;AEDO_employer_code,&lt;BR /&gt;AEDO_TX_DATE_YEAR,&lt;BR /&gt;//num(tMonth) as tMonth&lt;BR /&gt;&lt;STRONG&gt;if(Month(AEDO_tran_date) = Month(AEDO_runout_date),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(Day(AEDO_tran_date) &amp;lt;= (1) and Day(AEDO_runout_date) &amp;gt;= (1), 'x'),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(Day(AEDO_tran_date) &amp;lt;= (1) or Day(AEDO_runout_date) &amp;gt;= (1), 'x')) as 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Resident AEDO&lt;BR /&gt;Where xml_transaction_type = 'AEDO_FUTURE';&lt;/P&gt;&lt;P&gt;Drop Tables AEDO, Loans;&lt;BR /&gt;Exit Script;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2019 09:20:36 GMT</pubDate>
    <dc:creator>BouwerVa</dc:creator>
    <dc:date>2019-11-27T09:20:36Z</dc:date>
    <item>
      <title>Compare Loop Variable to Day(Date)</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651713#M447896</link>
      <description>&lt;P&gt;Hi I want to compare a Loop Variable to the Day of a Date Field.&lt;/P&gt;&lt;P&gt;When I hard code the Following Code is work Perfectly:&lt;/P&gt;&lt;P&gt;ExportFile_Future:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD Distinct&lt;BR /&gt;AEDO_transaction_id,&lt;BR /&gt;OPPS,&lt;BR /&gt;AM,&lt;BR /&gt;BFS_BRANCH_NAME,&lt;BR /&gt;EMPL_NAME,&lt;BR /&gt;AEDO_employer_code,&lt;BR /&gt;AEDO_TX_DATE_YEAR,&lt;BR /&gt;//num(tMonth) as tMonth&lt;BR /&gt;&lt;STRONG&gt;if(Month(AEDO_tran_date) = Month(AEDO_runout_date),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(Day(AEDO_tran_date) &amp;lt;= (1) and Day(AEDO_runout_date) &amp;gt;= (1), 'x'),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(Day(AEDO_tran_date) &amp;lt;= (1) or Day(AEDO_runout_date) &amp;gt;= (1), 'x')) as 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I put it in a loop it returns a Null Value:&lt;/P&gt;&lt;P&gt;For iD = 1 to 4&lt;BR /&gt;Trace &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Join Export File '$(iD)' &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;;&lt;BR /&gt;//Temp:&lt;BR /&gt;//NoConcatenate&lt;BR /&gt;Left Join (ExportFile_Future)&lt;BR /&gt;LOAD&lt;BR /&gt;AEDO_transaction_id,&lt;BR /&gt;OPPS,&lt;BR /&gt;AM,&lt;BR /&gt;BFS_BRANCH_NAME,&lt;BR /&gt;EMPL_NAME,&lt;BR /&gt;AEDO_employer_code,&lt;BR /&gt;'Future' as AEDO_TX_DATE_YEAR,&lt;BR /&gt;//tMonth,&lt;BR /&gt;IsNum($(iD)) as test,&lt;BR /&gt;&lt;STRONG&gt;if(Month(AEDO_tran_date) = Month(AEDO_runout_date),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(Num(Day(AEDO_tran_date)) &amp;lt;= Num($(iD)) and Num(Day(AEDO_runout_date)) &amp;gt;= Num($(iD)), 'x'),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(Num(Day(AEDO_tran_date)) &amp;lt;= Num($(iD)) or Num(Day(AEDO_runout_date)) &amp;gt;= Num($(iD)), 'x')) as $(iD)&lt;/STRONG&gt;&lt;BR /&gt;Resident AEDO&lt;BR /&gt;Where xml_transaction_type = 'AEDO_FUTURE';&lt;/P&gt;&lt;P&gt;Next iD&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:50:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651713#M447896</guid>
      <dc:creator>BouwerVa</dc:creator>
      <dc:date>2024-11-16T01:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Loop Variable to Day(Date)</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651736#M447899</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you give us more details about the script or complete it?&lt;BR /&gt;for example what is the table "AEDO" in Resident, ... or send a sample data.&lt;/P&gt;&lt;P&gt;for example in this code "Left Join (ExportFile_Future)" while (ExportFile_Future) is still empty, it is normal that it returns nulls, each time we join with null.&lt;/P&gt;&lt;P&gt;send us a sample data so that it is easy to interpret the code&lt;/P&gt;&lt;P&gt;Taoufiq&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 08:59:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651736#M447899</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2019-11-27T08:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Loop Variable to Day(Date)</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651752#M447900</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Code with Loop:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Trace Left Join Day Columns;&lt;BR /&gt;ExportFile_Future:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD Distinct&lt;BR /&gt;AEDO_transaction_id,&lt;BR /&gt;OPPS,&lt;BR /&gt;AM,&lt;BR /&gt;BFS_BRANCH_NAME,&lt;BR /&gt;EMPL_NAME,&lt;BR /&gt;AEDO_employer_code,&lt;BR /&gt;AEDO_TX_DATE_YEAR&lt;/P&gt;&lt;P&gt;Resident AEDO&lt;BR /&gt;Where xml_transaction_type = 'AEDO_FUTURE';&lt;/P&gt;&lt;P&gt;For iD = 1 to 4&lt;BR /&gt;Trace &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Join Export File '$(iD)' &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;;&lt;BR /&gt;//Temp:&lt;BR /&gt;//NoConcatenate&lt;BR /&gt;Left Join (ExportFile_Future)&lt;BR /&gt;LOAD&lt;BR /&gt;AEDO_transaction_id,&lt;BR /&gt;OPPS,&lt;BR /&gt;AM,&lt;BR /&gt;BFS_BRANCH_NAME,&lt;BR /&gt;EMPL_NAME,&lt;BR /&gt;AEDO_employer_code,&lt;BR /&gt;'Future' as AEDO_TX_DATE_YEAR,&lt;BR /&gt;//tMonth,&lt;BR /&gt;IsNum($(iD)) as test,&lt;BR /&gt;if(Month(AEDO_tran_date) = Month(AEDO_runout_date),&lt;BR /&gt;if(Num(Day(AEDO_tran_date)) &amp;lt;= Num($(iD)) and Num(Day(AEDO_runout_date)) &amp;gt;= Num($(iD)), 'x'),&lt;BR /&gt;if(Num(Day(AEDO_tran_date)) &amp;lt;= Num($(iD)) or Num(Day(AEDO_runout_date)) &amp;gt;= Num($(iD)), 'x')) as $(iD)&lt;BR /&gt;Resident AEDO&lt;BR /&gt;Where xml_transaction_type = 'AEDO_FUTURE';&lt;/P&gt;&lt;P&gt;Next iD&lt;/P&gt;&lt;P&gt;Drop Tables AEDO, Loans;&lt;BR /&gt;Exit Script;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 09:19:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651752#M447900</guid>
      <dc:creator>BouwerVa</dc:creator>
      <dc:date>2019-11-27T09:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Loop Variable to Day(Date)</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651754#M447901</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Code without Loop:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(This one works but the I have to repeat code in bold x 31 Times)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Trace Left Join Day Columns;&lt;BR /&gt;ExportFile_Future:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD Distinct&lt;BR /&gt;AEDO_transaction_id,&lt;BR /&gt;OPPS,&lt;BR /&gt;AM,&lt;BR /&gt;BFS_BRANCH_NAME,&lt;BR /&gt;EMPL_NAME,&lt;BR /&gt;AEDO_employer_code,&lt;BR /&gt;AEDO_TX_DATE_YEAR,&lt;BR /&gt;//num(tMonth) as tMonth&lt;BR /&gt;&lt;STRONG&gt;if(Month(AEDO_tran_date) = Month(AEDO_runout_date),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(Day(AEDO_tran_date) &amp;lt;= (1) and Day(AEDO_runout_date) &amp;gt;= (1), 'x'),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if(Day(AEDO_tran_date) &amp;lt;= (1) or Day(AEDO_runout_date) &amp;gt;= (1), 'x')) as 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Resident AEDO&lt;BR /&gt;Where xml_transaction_type = 'AEDO_FUTURE';&lt;/P&gt;&lt;P&gt;Drop Tables AEDO, Loans;&lt;BR /&gt;Exit Script;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 09:20:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651754#M447901</guid>
      <dc:creator>BouwerVa</dc:creator>
      <dc:date>2019-11-27T09:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Loop Variable to Day(Date)</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651844#M447911</link>
      <description>&lt;P&gt;I suggest that you rethink your whole approach because it creates (with quite heavy join-loops) a crosstable which is usually very expensive to handle (in script and UI). Often there are better ways to create an appropriate datamodel and in your case it might be with the use of an &lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/IntervalMatch/ba-p/1464547" target="_self"&gt;IntervalMatch&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 11:44:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Loop-Variable-to-Day-Date/m-p/1651844#M447911</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-11-27T11:44:29Z</dc:date>
    </item>
  </channel>
</rss>

