<?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 [resolved] How to display week number in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-display-week-number/m-p/2366053#M129586</link>
    <description>Hi
&lt;BR /&gt;I have a need to show CalendarYearweek and FiscalYearweek based on a configurable start date extending till 5000 days. Here Calendar Year means 1st Jan to 31st Dec and Fiscal Year means 1st July to 30th June.
&lt;BR /&gt;For CalendarYearweek: I did it this way: 
&lt;B&gt;Integer.parseInt(TalendDate.formatDate("w", row1.date))&lt;/B&gt; when i do this, i get all week numbers accurately except for the last week of 2011. My custom start date is from
&lt;B&gt; 01st July 2010&lt;/B&gt;, Last week of 2010 i.e., Dates in YYYYMMDD - (20101226 to 20101231) is showing as 1 instead of 53.
&lt;BR /&gt;For Fiscal Year: How do I calculate the Fiscal Year week assuming the financial year starts at July 1st of ever year?
&lt;BR /&gt;Best Regards,
&lt;BR /&gt;Kalyan</description>
    <pubDate>Thu, 16 Oct 2014 11:55:44 GMT</pubDate>
    <dc:creator>satyavar</dc:creator>
    <dc:date>2014-10-16T11:55:44Z</dc:date>
    <item>
      <title>[resolved] How to display week number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-display-week-number/m-p/2366053#M129586</link>
      <description>Hi
&lt;BR /&gt;I have a need to show CalendarYearweek and FiscalYearweek based on a configurable start date extending till 5000 days. Here Calendar Year means 1st Jan to 31st Dec and Fiscal Year means 1st July to 30th June.
&lt;BR /&gt;For CalendarYearweek: I did it this way: 
&lt;B&gt;Integer.parseInt(TalendDate.formatDate("w", row1.date))&lt;/B&gt; when i do this, i get all week numbers accurately except for the last week of 2011. My custom start date is from
&lt;B&gt; 01st July 2010&lt;/B&gt;, Last week of 2010 i.e., Dates in YYYYMMDD - (20101226 to 20101231) is showing as 1 instead of 53.
&lt;BR /&gt;For Fiscal Year: How do I calculate the Fiscal Year week assuming the financial year starts at July 1st of ever year?
&lt;BR /&gt;Best Regards,
&lt;BR /&gt;Kalyan</description>
      <pubDate>Thu, 16 Oct 2014 11:55:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-display-week-number/m-p/2366053#M129586</guid>
      <dc:creator>satyavar</dc:creator>
      <dc:date>2014-10-16T11:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to display week number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-display-week-number/m-p/2366054#M129587</link>
      <description>Hello, 
&lt;BR /&gt;You can do a little bit of math to calculate what you seem to want. &amp;nbsp;I've broken this up into multiple lines to make it more readable, but you could cram them into a single line: 
&lt;BR /&gt; 
&lt;PRE&gt;//get the date as a date.&lt;BR /&gt;Date date = TalendDate.parseDate("yyyyMMdd","20101231");&lt;BR /&gt;//get month as a number NOTE: this starts at 0 for January and goes to 11 for December.&lt;BR /&gt;int month = TalendDate.getPartOfDate("MONTH",date);&lt;BR /&gt;//get week of year*&lt;BR /&gt;int weekOfYear = TalendDate.getPartOfDate("WEEK_OF_YEAR",date);&lt;BR /&gt;//get our desired calendar year, 26 is chosen arbitrarily since it's simply the halfway point of a year.&lt;BR /&gt;int calendarWeek = month==11 &amp;amp;&amp;amp; weekOfYear &amp;lt; 26 ? weekOfYear+52 : weekOfYear;&lt;BR /&gt;//get fiscal week.&lt;BR /&gt;int fiscalWeek = calendarWeek &amp;gt; 26 &amp;amp;&amp;amp; month&amp;gt;=6 ? calendarWeek-26 : calendarWeek+26;&lt;/PRE&gt; 
&lt;BR /&gt;Will output the following for the dates included in the print statements: 
&lt;BR /&gt; 
&lt;PRE&gt; connecting to socket on port 4063&lt;BR /&gt; connected&lt;BR /&gt;month = 5&lt;BR /&gt;various week stuff for date: 20100630&lt;BR /&gt;Week of Year&lt;BR /&gt; Calendar: 27&lt;BR /&gt; Fiscal: 53&lt;BR /&gt;month = 6&lt;BR /&gt;various week stuff for date: 20100701&lt;BR /&gt;Week of Year&lt;BR /&gt; Calendar: 27&lt;BR /&gt; Fiscal: 1&lt;BR /&gt;month = 11&lt;BR /&gt;various week stuff for date: 20101226&lt;BR /&gt;Week of Year&lt;BR /&gt; Calendar: 53&lt;BR /&gt; Fiscal: 27&lt;BR /&gt;month = 11&lt;BR /&gt;various week stuff for date: 20101231&lt;BR /&gt;Week of Year&lt;BR /&gt; Calendar: 53&lt;BR /&gt; Fiscal: 27&lt;BR /&gt;month = 0&lt;BR /&gt;various week stuff for date: 20100101&lt;BR /&gt;Week of Year&lt;BR /&gt; Calendar: 1&lt;BR /&gt; Fiscal: 27&lt;BR /&gt; disconnected&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Hope that helps!</description>
      <pubDate>Fri, 17 Oct 2014 19:41:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-display-week-number/m-p/2366054#M129587</guid>
      <dc:creator>rbaldwin</dc:creator>
      <dc:date>2014-10-17T19:41:46Z</dc:date>
    </item>
  </channel>
</rss>

