<?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: [resolved] Using Current date as a filter in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283705#M57541</link>
    <description>Hi 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Is it possible to move the filtering condition inside the tMap instead of tFilterRow. By filtering it within tMap, only the rows that are necessary would be fetched.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Yes, it is possible, you can add the filter condition on tMap. 
&lt;BR /&gt;filter condition: 
&lt;BR /&gt; 
&lt;PRE&gt;MyRoutine11709.getQuarter(row1.SaleDate).equals(MyRoutine11709.getQuarter(TalendDate.getCurrentDate()))&lt;/PRE&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
    <pubDate>Sun, 25 Jul 2010 05:28:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-07-25T05:28:08Z</dc:date>
    <item>
      <title>[resolved] Using Current date as a filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283701#M57537</link>
      <description>We started using TOS 4.0.2 in our organization and would like some input on designing a report that is described below (in terms of components that could be used, to efficiently do the job)
&lt;BR /&gt;Scenario: Report to be generated with data from Sales table. The report has to run every week taking CURRENT DATE as an input. Based on the date, it needs to be mapped to a quarter (example: July 1st - Sep 30th: = 3rd quarter and so on). The quarter dates are not available in tables and need to be hardcoded. 
&lt;BR /&gt;Then, the report needs to be pick up all the sales for the current quarter (based on the sale date) and display them in a report along with current Quarter name.
&lt;BR /&gt;Source table
&lt;BR /&gt;SaleID SaleDate Qty Region
&lt;BR /&gt;1 2010/01/20 3500 North
&lt;BR /&gt;2 2010/05/15 1500 East
&lt;BR /&gt;3 2010/07/15 1500 North
&lt;BR /&gt;4 2010/07/15 2500 South
&lt;BR /&gt;5 2010/07/20 1000 South
&lt;BR /&gt;Output (cased on current date as July 22nd)
&lt;BR /&gt;Region Quarter Total_Sales
&lt;BR /&gt;North Q3 1500
&lt;BR /&gt;South Q3 3500</description>
      <pubDate>Sat, 16 Nov 2024 13:20:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283701#M57537</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using Current date as a filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283702#M57538</link>
      <description>Hi 
&lt;BR /&gt;Here is an example, I create a routine to get the quarter base on SaleDate column. 
&lt;BR /&gt;in.csv: 
&lt;BR /&gt; 
&lt;B&gt;&lt;BR /&gt;1 2010/01/20 3500 North&lt;BR /&gt;2 2010/05/15 1500 East&lt;BR /&gt;3 2010/07/15 1500 North&lt;BR /&gt;4 2010/07/15 2500 South&lt;BR /&gt;5 2010/07/20 1000 South&lt;BR /&gt;&lt;/B&gt; 
&lt;BR /&gt;MyRoutine11709 
&lt;BR /&gt; 
&lt;PRE&gt;package routines;&lt;BR /&gt;public class MyRoutine11709 {&lt;BR /&gt;	static int month = 0;&lt;BR /&gt;	static String quarter = null;&lt;BR /&gt;	public static String getQuarter(java.util.Date date) {&lt;BR /&gt;		month = date.getMonth() + 1;&lt;BR /&gt;		if (month &amp;gt;= 1 &amp;amp;&amp;amp; month &amp;lt;= 3) {&lt;BR /&gt;			quarter = "Q1";&lt;BR /&gt;		}&lt;BR /&gt;		if (month &amp;gt;= 4 &amp;amp;&amp;amp; month &amp;lt;= 6) {&lt;BR /&gt;			quarter = "Q2";&lt;BR /&gt;		}&lt;BR /&gt;		if (month &amp;gt;= 7 &amp;amp;&amp;amp; month &amp;lt;= 9) {&lt;BR /&gt;			quarter = "Q3";&lt;BR /&gt;		}&lt;BR /&gt;		if (month &amp;gt;= 10 &amp;amp;&amp;amp; month &amp;lt;= 12) {&lt;BR /&gt;			quarter = "Q4";&lt;BR /&gt;		}&lt;BR /&gt;		return quarter;&lt;BR /&gt;	}&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;Code in tFilterRow: 
&lt;BR /&gt; 
&lt;PRE&gt;input_row.Quarter.equals(MyRoutine11709.getQuarter(TalendDate.getCurrentDate()))&lt;/PRE&gt; 
&lt;BR /&gt;Result: 
&lt;BR /&gt; 
&lt;PRE&gt;Starting job forum11709 at 10:26 23/07/2010.&lt;BR /&gt; connecting to socket on port 3493&lt;BR /&gt; connected&lt;BR /&gt;.------+-------+-----------.&lt;BR /&gt;|        tLogRow_1         |&lt;BR /&gt;|=-----+-------+----------=|&lt;BR /&gt;|region|Quarter|Total_Sales|&lt;BR /&gt;|=-----+-------+----------=|&lt;BR /&gt;|North |Q3     |1500       |&lt;BR /&gt;|South |Q3     |3500       |&lt;BR /&gt;'------+-------+-----------'&lt;BR /&gt; disconnected&lt;BR /&gt;Job forum11709 ended at 10:26 23/07/2010. &lt;/PRE&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 23 Jul 2010 03:39:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283702#M57538</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-23T03:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using Current date as a filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283703#M57539</link>
      <description>Shong,
&lt;BR /&gt;You're doing an amazing job !! I hope the talend community knows how helpful you are.
&lt;BR /&gt;Best regards;</description>
      <pubDate>Fri, 23 Jul 2010 03:57:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283703#M57539</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-23T03:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using Current date as a filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283704#M57540</link>
      <description>That's a beautiful explanation. Thank You so much for your detailed work. I implemented the solution with minor modifications and it works real well. Modified the routine to use calendar object. One more thing that I was exploring. Is it possible to move the filtering condition inside the tMap instead of tFilterRow. By filtering it within tMap, only the rows that are necessary would be fetched. Anyways, thank you so much</description>
      <pubDate>Sat, 24 Jul 2010 21:48:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283704#M57540</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-24T21:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using Current date as a filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283705#M57541</link>
      <description>Hi 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Is it possible to move the filtering condition inside the tMap instead of tFilterRow. By filtering it within tMap, only the rows that are necessary would be fetched.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Yes, it is possible, you can add the filter condition on tMap. 
&lt;BR /&gt;filter condition: 
&lt;BR /&gt; 
&lt;PRE&gt;MyRoutine11709.getQuarter(row1.SaleDate).equals(MyRoutine11709.getQuarter(TalendDate.getCurrentDate()))&lt;/PRE&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Sun, 25 Jul 2010 05:28:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283705#M57541</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-25T05:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using Current date as a filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283706#M57542</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Shong,&lt;BR /&gt;You're doing an amazing job !! I hope the talend community knows how helpful you are.&lt;BR /&gt;Best regards;&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;You inspire Us, Sir Shong! 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Mon, 26 Jul 2010 07:07:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-Current-date-as-a-filter/m-p/2283706#M57542</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-26T07:07:14Z</dc:date>
    </item>
  </channel>
</rss>

