<?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: Date Routine in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282113#M56431</link>
    <description>Hi! Thank you so much for your replies of this topic.&lt;BR /&gt;I found a solution like this:&lt;BR /&gt;1)First I used a variable in tmap component called mes&lt;BR /&gt;mes=Mathematical.INT(TalendDate.formatDate("MM",row2.fecha))&lt;BR /&gt;2) In the same way, I use another variable called anio.&lt;BR /&gt;anio= TalendDate.formatDate("yyyy", row2.fecha) &lt;BR /&gt;3) Then I used both variables and concat because I needed some like this: 20123, where 2012 is the year, and 3 the quarter of year.&lt;BR /&gt;Var.mes&amp;lt;=3?Var.anio.concat("1"):Var.mes&amp;lt;=6?Var.anio.concat("2"):Var.mes&amp;lt;=9?Var.anio.concat("3"):Var.anio.concat("4");  &lt;BR /&gt;I attach some pictures&lt;BR /&gt;Regards and thak you so much!!</description>
    <pubDate>Fri, 28 Sep 2012 14:04:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-09-28T14:04:44Z</dc:date>
    <item>
      <title>Date Routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282109#M56427</link>
      <description>Hi! I have some trouble with Java routines in Talend. I need to generate some routine which calculate a quarter of the year to load a time dimension. Then, I use it in tmap component. 
&lt;BR /&gt;In java code, would be like this:
&lt;BR /&gt;switch (mes)
&lt;BR /&gt;case 1
&lt;BR /&gt;case 2
&lt;BR /&gt;case 3
&lt;BR /&gt;quarter=1
&lt;BR /&gt;break;
&lt;BR /&gt;case 4
&lt;BR /&gt;case 5
&lt;BR /&gt;case 6
&lt;BR /&gt;quarter=2
&lt;BR /&gt;break;
&lt;BR /&gt;case 7
&lt;BR /&gt;case 8
&lt;BR /&gt;case 9
&lt;BR /&gt;quarter=3
&lt;BR /&gt;break;
&lt;BR /&gt;case 10
&lt;BR /&gt;case 11
&lt;BR /&gt;case 12
&lt;BR /&gt;quarter=4
&lt;BR /&gt;break;
&lt;BR /&gt;I have a date variable called "fecha", who maps to another component tmap. There I use "fecha" to generate a kind of time attributes; one of this is quarter. 
&lt;BR /&gt;My question is...how I must take this variable "fecha" in java routine to obtain month and make the code?. Date is in this format ("dd-MM-yyyy")
&lt;BR /&gt;And then, how I use this routine in tmap component?
&lt;BR /&gt;The picture shows date variable in tmap</description>
      <pubDate>Tue, 25 Sep 2012 14:58:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282109#M56427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-25T14:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date Routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282110#M56428</link>
      <description>Hi,
&lt;BR /&gt;The month of your date field can determined by using 
&lt;BR /&gt;new SimpleDateFormat("MM").format(row2.fecha)
&lt;BR /&gt;You can use this as input to your switch statement.
&lt;BR /&gt;Hope this helps.
&lt;BR /&gt;Regards,
&lt;BR /&gt;Arno</description>
      <pubDate>Tue, 25 Sep 2012 16:18:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282110#M56428</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-25T16:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Date Routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282111#M56429</link>
      <description>Just use the following expression to get the quarter of fecha: 
&lt;BR /&gt;TalendDate.getPartOfDate("MONTH",row2.fecha)/3+1</description>
      <pubDate>Fri, 28 Sep 2012 05:32:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282111#M56429</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2012-09-28T05:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date Routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282112#M56430</link>
      <description>Then vote for 
&lt;A href="https://jira.talendforge.org/browse/TDI-21783" rel="nofollow noopener noreferrer"&gt;https://jira.talendforge.org/browse/TDI-21783&lt;/A&gt;! 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Fri, 28 Sep 2012 05:34:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282112#M56430</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2012-09-28T05:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Date Routine</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282113#M56431</link>
      <description>Hi! Thank you so much for your replies of this topic.&lt;BR /&gt;I found a solution like this:&lt;BR /&gt;1)First I used a variable in tmap component called mes&lt;BR /&gt;mes=Mathematical.INT(TalendDate.formatDate("MM",row2.fecha))&lt;BR /&gt;2) In the same way, I use another variable called anio.&lt;BR /&gt;anio= TalendDate.formatDate("yyyy", row2.fecha) &lt;BR /&gt;3) Then I used both variables and concat because I needed some like this: 20123, where 2012 is the year, and 3 the quarter of year.&lt;BR /&gt;Var.mes&amp;lt;=3?Var.anio.concat("1"):Var.mes&amp;lt;=6?Var.anio.concat("2"):Var.mes&amp;lt;=9?Var.anio.concat("3"):Var.anio.concat("4");  &lt;BR /&gt;I attach some pictures&lt;BR /&gt;Regards and thak you so much!!</description>
      <pubDate>Fri, 28 Sep 2012 14:04:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-Routine/m-p/2282113#M56431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-28T14:04:44Z</dc:date>
    </item>
  </channel>
</rss>

