<?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] Concatenate strings to date in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290162#M63470</link>
    <description>You are welcome Felix&lt;BR /&gt;BR</description>
    <pubDate>Tue, 10 Jun 2014 15:53:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-06-10T15:53:36Z</dc:date>
    <item>
      <title>[resolved] Concatenate strings to date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290158#M63466</link>
      <description>Hi, 
&lt;BR /&gt;Being new to TOS I'm still struggling with the beginners lack of experience. I'll be happy if somebody could help me on the following problem: 
&lt;BR /&gt;I am trying to create a date with the following values (fields) available: 
&lt;BR /&gt;month (string) 
&lt;BR /&gt;year (string) 
&lt;BR /&gt;additionally I'll add '01' for the first day of a month, since there is no need any other day in a month 
&lt;BR /&gt;In the expression editor of the tMap component the date should been assembled like this: 
&lt;BR /&gt;TalendDate.parseDate("yyyy-MM-dd",fieldYear+"-"+fieldMonth+"-01") 
&lt;BR /&gt;When I run the job I get the following error: 
&lt;BR /&gt; connected 
&lt;BR /&gt;java.lang.NumberFormatException: For input string: "1-" 
&lt;BR /&gt; at java.lang.NumberFormatException.forInputString(Unknown Source) 
&lt;BR /&gt; at java.lang.Integer.parseInt(Unknown Source) 
&lt;BR /&gt; at java.lang.Integer.parseInt(Unknown Source) 
&lt;BR /&gt; at routines.system.FastDateParser$DateParser.parse(FastDateParser.java:129) 
&lt;BR /&gt; at java.text.DateFormat.parse(Unknown Source) 
&lt;BR /&gt; at routines.TalendDate.parseDate(TalendDate.java:850) 
&lt;BR /&gt; at routines.TalendDate.parseDate(TalendDate.java:808) 
&lt;BR /&gt; at rd_data_personal.lohnexp_0_1.lohnExp.tDBInput_1Process(lohnExp.java:1509) 
&lt;BR /&gt; at rd_data_personal.lohnexp_0_1.lohnExp.runJobInTOS(lohnExp.java:1963) 
&lt;BR /&gt; at rd_data_personal.lohnexp_0_1.lohnExp.main(lohnExp.java:1822) 
&lt;BR /&gt;Exception in component tMap_1 
&lt;BR /&gt;java.lang.RuntimeException: java.text.ParseException: Unparseable date: "2014-1-01" 
&lt;BR /&gt; at routines.TalendDate.parseDate(TalendDate.java:864) 
&lt;BR /&gt; at routines.TalendDate.parseDate(TalendDate.java:808) 
&lt;BR /&gt; at rd_data_personal.lohnexp_0_1.lohnExp.tDBInput_1Process(lohnExp.java:1509) 
&lt;BR /&gt; at rd_data_personal.lohnexp_0_1.lohnExp.runJobInTOS(lohnExp.java:1963) 
&lt;BR /&gt; at rd_data_personal.lohnexp_0_1.lohnExp.main(lohnExp.java:1822) 
&lt;BR /&gt;Caused by: java.text.ParseException: Unparseable date: "2014-1-01" 
&lt;BR /&gt; at java.text.DateFormat.parse(Unknown Source) 
&lt;BR /&gt; at routines.TalendDate.parseDate(TalendDate.java:850) 
&lt;BR /&gt; ... 4 more 
&lt;BR /&gt; disconnected 
&lt;BR /&gt;Job lohnExp ended at 15:13 10/06/2014. 
&lt;BR /&gt; 
&lt;BR /&gt;Thanks for any suggestion on how to solve this, 
&lt;BR /&gt;Felix</description>
      <pubDate>Tue, 10 Jun 2014 14:16:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290158#M63466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-10T14:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Concatenate strings to date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290159#M63467</link>
      <description>Hi, &lt;BR /&gt;   u can display yours String in the console with tLogRow component or tJavaRow  component with System.ou.println(fieldYear);&lt;BR /&gt;   i guess that value of fieldYear is 1 instead of 2014</description>
      <pubDate>Tue, 10 Jun 2014 15:19:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290159#M63467</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-10T15:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Concatenate strings to date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290160#M63468</link>
      <description>Hi, 
&lt;BR /&gt;Your month string should have lengh of 2 characters. 
&lt;BR /&gt;So if it is less than 10 you should pad with 0 at the left before parsing the string into Date. 
&lt;BR /&gt;Here is how to padd your month with "0" when less than 10: 
&lt;BR /&gt;Integer.valueOf(fieldMonth)&amp;lt;10 ? "0"+fieldMonth: fieldMonth 
&lt;BR /&gt;So you use the result of this ternary expression in your parsedate function. 
&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 10 Jun 2014 15:28:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290160#M63468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-10T15:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Concatenate strings to date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290161#M63469</link>
      <description>Thanks guys for the quick reply :-).
&lt;BR /&gt;@sofbar: your code just did the job, it was the missing 0 in the month field.
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Felix</description>
      <pubDate>Tue, 10 Jun 2014 15:48:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290161#M63469</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-10T15:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Concatenate strings to date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290162#M63470</link>
      <description>You are welcome Felix&lt;BR /&gt;BR</description>
      <pubDate>Tue, 10 Jun 2014 15:53:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Concatenate-strings-to-date/m-p/2290162#M63470</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-10T15:53:36Z</dc:date>
    </item>
  </channel>
</rss>

