<?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: Export File with offset week number as filename in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Export-File-with-offset-week-number-as-filename/m-p/2210243#M8741</link>
    <description>&lt;P&gt;Have you tried subtracting 7 days from the current date?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Sep 2018 13:00:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-09-21T13:00:10Z</dc:date>
    <item>
      <title>Export File with offset week number as filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Export-File-with-offset-week-number-as-filename/m-p/2210242#M8740</link>
      <description>&lt;P&gt;I have a relatively simple task which I can't seem to get my head around.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I've created a job which queries a database and outputs the results in an excel file for end users to utilise.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The file has data pertaining to business transacted by the company in the previous week and I need to output the file with previous week number. I currently can get the file to output with the current week number using the Filename field in tFileOutputExcel Component as follows:&lt;/P&gt; 
&lt;P&gt;"$$PATH\\FILENAME WEEK "+TalendDate.getPartOfDate("WEEK_OF_YEAR", TalendDate.parseDate("dd-MM-yyyy", TalendDate.getDate("dd-MM-YYYY")))+"xlsx"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This outputs "FILENAME WEEK 38" but I need it to be offset by -1 week, so it is named "FILENAME WEEK 37 and I can't figure out how to get this to work as it doesn't seem to follow the same logic as the daily one:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;+TalendDate.addDate(TalendDate.getDate("yyyyMMdd"),"yyyyMMdd",-1,"dd") - This will produce an offset of 1 day&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Any insight would be greatly appreciated.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm using version 6.4.1&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 12:43:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Export-File-with-offset-week-number-as-filename/m-p/2210242#M8740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-21T12:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Export File with offset week number as filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Export-File-with-offset-week-number-as-filename/m-p/2210243#M8741</link>
      <description>&lt;P&gt;Have you tried subtracting 7 days from the current date?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 13:00:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Export-File-with-offset-week-number-as-filename/m-p/2210243#M8741</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-21T13:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Export File with offset week number as filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Export-File-with-offset-week-number-as-filename/m-p/2210244#M8742</link>
      <description>&lt;P&gt;TalendDate.addDate(TalendDate.getDate("yyyyMMdd"),"yyyyMMdd",-&lt;FONT color="#ff0000"&gt;7&lt;/FONT&gt;,"dd")&lt;/P&gt;&lt;P&gt;week is 7 days&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 13:00:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Export-File-with-offset-week-number-as-filename/m-p/2210244#M8742</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2018-09-21T13:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Export File with offset week number as filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Export-File-with-offset-week-number-as-filename/m-p/2210245#M8743</link>
      <description>&lt;P&gt;This was my initial approach, but I realize now where I was going wrong - I needed to include the date adjustment as a nested TalendDate.getDate function within the parseDate function&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"$$PATH/FILENAME WEEK "+TalendDate.getPartOfDate("WEEK_OF_YEAR", TalendDate.parseDate("dd-MM-yyyy", TalendDate.getDate(TalendDate.addDate(TalendDate.getDate("dd-MM-yyyy"),"dd-MM-yyyy",-7,"dd")))) +".xlsx"&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 14:08:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Export-File-with-offset-week-number-as-filename/m-p/2210245#M8743</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-21T14:08:32Z</dc:date>
    </item>
  </channel>
</rss>

