<?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 How to get Week Start Date in tMap? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-Week-Start-Date-in-tMap/m-p/2370736#M133744</link>
    <description>&lt;P&gt;I have a requirement where I need to get the Start Date of the week (currently in iteration ). &lt;/P&gt;&lt;P&gt;For example -&lt;/P&gt;&lt;P&gt;If the current iteration date is "2020-07-21" then Start Date of the week should be "2020-07-19" (basically needs to be a Sunday and should be in string format only)&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 01:49:22 GMT</pubDate>
    <dc:creator>dipanjan93</dc:creator>
    <dc:date>2024-11-16T01:49:22Z</dc:date>
    <item>
      <title>How to get Week Start Date in tMap?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-Week-Start-Date-in-tMap/m-p/2370736#M133744</link>
      <description>&lt;P&gt;I have a requirement where I need to get the Start Date of the week (currently in iteration ). &lt;/P&gt;&lt;P&gt;For example -&lt;/P&gt;&lt;P&gt;If the current iteration date is "2020-07-21" then Start Date of the week should be "2020-07-19" (basically needs to be a Sunday and should be in string format only)&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:49:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-Week-Start-Date-in-tMap/m-p/2370736#M133744</guid>
      <dc:creator>dipanjan93</dc:creator>
      <dc:date>2024-11-16T01:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Week Start Date in tMap?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-Week-Start-Date-in-tMap/m-p/2370737#M133745</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;No a built-in function available for getting the start date of  a week. You can create a user routine and add this function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;public static String getFirstDayOfWeek(String date) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	LocalDate assigned_date =LocalDate.parse(date);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;(assigned_date.with(previousOrSame(SUNDAY))).toString();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then call this routine function on tJavaRow or tMap  to get the start date of a week based on the given date.  For example, on a tJavaRow:&lt;/P&gt;&lt;P&gt;output_row.startDate=RoutineName.getFirstDayOfWeek(input_row.given_date_column);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take a look at this KB article to learn how to create a user routine.  &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.talend.com/s/article/Create-a-user-routine-and-call-it-in-a-Job-0hHmU" alt="https://community.talend.com/s/article/Create-a-user-routine-and-call-it-in-a-Job-0hHmU" target="_blank"&gt;https://community.talend.com/s/article/Create-a-user-routine-and-call-it-in-a-Job-0hHmU&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 03:37:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-Week-Start-Date-in-tMap/m-p/2370737#M133745</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-23T03:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Week Start Date in tMap?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-Week-Start-Date-in-tMap/m-p/2370738#M133746</link>
      <description>&lt;P&gt;Hi @shong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the solution!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But in routines seems like LocalDate can't be resolved to a type. Please find the screenshot below for details -&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008vmNBAAY.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131523i00622E633A480CB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008vmNBAAY.jpg" alt="0693p000008vmNBAAY.jpg" /&gt;&lt;/span&gt; Can we do anything here? Or is there any other way to handle this scenario?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 04:14:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-Week-Start-Date-in-tMap/m-p/2370738#M133746</guid>
      <dc:creator>dipanjan93</dc:creator>
      <dc:date>2020-07-23T04:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Week Start Date in tMap?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-Week-Start-Date-in-tMap/m-p/2370739#M133747</link>
      <description>&lt;P&gt;You need to import these class in the import section of routine.&lt;/P&gt;&lt;P&gt;import java.time.LocalDate;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import static java.time.DayOfWeek.SUNDAY;&lt;/P&gt;&lt;P&gt;import static java.time.temporal.TemporalAdjusters.previousOrSame;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008vmV5AAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144159i732D492F68185394/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008vmV5AAI.png" alt="0693p000008vmV5AAI.png" /&gt;&lt;/span&gt;​&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 08:03:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-Week-Start-Date-in-tMap/m-p/2370739#M133747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-23T08:03:12Z</dc:date>
    </item>
  </channel>
</rss>

