<?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: TalendDate Question. in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293561#M66522</link>
    <description>Additionally on this. When I'm using he formula editor what is the construct used within. I found this code to get the last date of the month,
&lt;BR /&gt;import java.util.Calendar;
&lt;BR /&gt;public class Main {
&lt;BR /&gt; public static void main(String[] args) {
&lt;BR /&gt; Calendar calendar = Calendar.getInstance();
&lt;BR /&gt; int lastDate = calendar.getActualMaximum(Calendar.DATE);
&lt;BR /&gt; System.out.println("Date : " + calendar.getTime());
&lt;BR /&gt; System.out.println("Last Date: " + lastDate);
&lt;BR /&gt; }
&lt;BR /&gt;}
&lt;BR /&gt;So if I want to use the calendar class within the formula editor do I have to import it as in the above, do I format the code the same way or do I need to make this a separate subroutine such as talenddate is?
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Bluesin</description>
    <pubDate>Thu, 07 May 2009 21:07:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-05-07T21:07:02Z</dc:date>
    <item>
      <title>TalendDate Question.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293558#M66519</link>
      <description>Hi I'd like to add a date field to my data that basically contains the date for the first day of the month, is there a way to use talenddate to extract the current month and year from the current date and then format a date field using the extracted data as in "extractedyear, extracted month, 01".
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Bluesin</description>
      <pubDate>Sat, 16 Nov 2024 13:58:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293558#M66519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: TalendDate Question.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293559#M66520</link>
      <description>Will this work?
&lt;BR /&gt;In TMAP I added the field date and then opened up the formula editor and put this in,
&lt;BR /&gt;DateSerial(Year(Date), Month(Date) , 1)
&lt;BR /&gt;Will that do it?
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Bluesin</description>
      <pubDate>Thu, 07 May 2009 20:35:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293559#M66520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-05-07T20:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: TalendDate Question.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293560#M66521</link>
      <description>Oops, sorry the above came from an ASP page that I thought was Java as I did a search on Java Date... 
&lt;BR /&gt;My Bad 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M9xp.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153774i2D37DB4356C217DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M9xp.png" alt="0683p000009M9xp.png" /&gt;&lt;/span&gt;) 
&lt;BR /&gt;Bluesin</description>
      <pubDate>Thu, 07 May 2009 20:49:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293560#M66521</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-05-07T20:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: TalendDate Question.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293561#M66522</link>
      <description>Additionally on this. When I'm using he formula editor what is the construct used within. I found this code to get the last date of the month,
&lt;BR /&gt;import java.util.Calendar;
&lt;BR /&gt;public class Main {
&lt;BR /&gt; public static void main(String[] args) {
&lt;BR /&gt; Calendar calendar = Calendar.getInstance();
&lt;BR /&gt; int lastDate = calendar.getActualMaximum(Calendar.DATE);
&lt;BR /&gt; System.out.println("Date : " + calendar.getTime());
&lt;BR /&gt; System.out.println("Last Date: " + lastDate);
&lt;BR /&gt; }
&lt;BR /&gt;}
&lt;BR /&gt;So if I want to use the calendar class within the formula editor do I have to import it as in the above, do I format the code the same way or do I need to make this a separate subroutine such as talenddate is?
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Bluesin</description>
      <pubDate>Thu, 07 May 2009 21:07:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293561#M66522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-05-07T21:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: TalendDate Question.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293562#M66523</link>
      <description>Ok, so I created a routine to return the date for the last day of the month for the previous month, this is it,
&lt;BR /&gt; public static String getDate() {
&lt;BR /&gt; Calendar now = Calendar.getInstance();
&lt;BR /&gt; now = Calendar.getInstance();
&lt;BR /&gt; now.add(Calendar.MONTH, -0);
&lt;BR /&gt; return (now.get(Calendar.YEAR) + "-" 
&lt;BR /&gt; + now.get(Calendar.MONTH) + "-" 
&lt;BR /&gt; +now.getActualMaximum(Calendar.DATE));
&lt;BR /&gt;I'd like to return it as a date, I am guessing I can copy the code for parsing the date from Talenddate to return it as a date, but if anyone has any other suggestions then please feel free...
&lt;BR /&gt;Bluesin</description>
      <pubDate>Fri, 08 May 2009 00:00:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293562#M66523</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-05-08T00:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: TalendDate Question.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293563#M66524</link>
      <description>Hello Bluesin
&lt;BR /&gt;If you return a String, you can use TalendDate to convert it to a Date on tMap, for example:
&lt;BR /&gt;
&lt;PRE&gt;TalendDate.parseDate("yyyy-MM-dd", yourRoutineName.getDate())&lt;/PRE&gt;
&lt;BR /&gt;Best regards
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Fri, 08 May 2009 02:57:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293563#M66524</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-05-08T02:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: TalendDate Question.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293564#M66525</link>
      <description>Thanks Shong, I thought about that however I figured I'd just do it all in my routine. Here's the whole routine for anyone who migh need such code, this will produce the last day of the month for any month based on what is passed to it. 
&lt;BR /&gt; public static Date getLastDate(String pattern, int MonthAdd) { 
&lt;BR /&gt; Calendar now = Calendar.getInstance(); 
&lt;BR /&gt; now = Calendar.getInstance(); 
&lt;BR /&gt; now.add(Calendar.MONTH, MonthAdd); 
&lt;BR /&gt; String MyDate = (now.get(Calendar.YEAR) + "-" 
&lt;BR /&gt; + String.format("%02d",(now.get(Calendar.MONTH) + 1)) + "-" 
&lt;BR /&gt; +now.getActualMaximum(Calendar.DATE)); 
&lt;BR /&gt; try { 
&lt;BR /&gt; return FastDateParser.getInstance(pattern).parse(MyDate); 
&lt;BR /&gt; } catch (ParseException e) { 
&lt;BR /&gt; throw new RuntimeException(e); 
&lt;BR /&gt; } 
&lt;BR /&gt;} 
&lt;BR /&gt;Its called like this from within TMAP 
&lt;BR /&gt;LastDayOfMonth.getLastDate("yyyy-MM-dd", -1) 
&lt;BR /&gt;Pretty cool, and a kudos to Talend for making the IDE so user friendly for a java newbie like me! 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;Bluesin</description>
      <pubDate>Fri, 08 May 2009 14:50:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-Question/m-p/2293564#M66525</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-05-08T14:50:28Z</dc:date>
    </item>
  </channel>
</rss>

