<?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: context getcurrentdate in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347022#M114348</link>
    <description>&lt;P&gt;If im not wrong you have to format it so that it matches the type. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this : &lt;/P&gt;&lt;P&gt;TalendDate.formatDate("YYYY-MM-DD",TalendDate.addDate(TalendDate.getCurrentDate(), -2, "HH"))&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you want something more/less like seconds etc, just change the pattern. And for your other problem, i dont understand what you want to do sorry. &lt;/P&gt;</description>
    <pubDate>Thu, 01 Jun 2023 07:57:37 GMT</pubDate>
    <dc:creator>Lord-Vader</dc:creator>
    <dc:date>2023-06-01T07:57:37Z</dc:date>
    <item>
      <title>context getcurrentdate</title>
      <link>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347019#M114345</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i designed a job to run on hourly basis on data -2 hours on timpalaload component&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i created a context start_date as below &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000htTLeAAM.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140111i68B15DFD430A553B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000htTLeAAM.png" alt="0695b00000htTLeAAM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and defined in tjavarow component as below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;context.Start_Time = TalendDate.formatDate("yyyyMMdd",TalendDate.getCurrentDate());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System.out.println("/////////////////////////////////////");&lt;/P&gt;&lt;P&gt;System.out.println("Running Day = " + context.Start_Time);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and used in the query as below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where&amp;nbsp;date_id = "+context.Start_Time+"&amp;nbsp;&lt;B&gt;and hour_id = ???????&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my question and issue is , i want to use hour_id = extracted hour -2 and avoid switching day @12AM on job schedule 00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for support&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:44:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347019#M114345</guid>
      <dc:creator>mshafeeq</dc:creator>
      <dc:date>2024-11-15T21:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: context getcurrentdate</title>
      <link>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347020#M114346</link>
      <description>&lt;P&gt;Hi @muhamd shafeeq​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get current hour -2 you could use this code: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TalendDate.addDate(TalendDate.getCurrentDate(), -2, "HH")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The addDate method will return a Talend Date object, then you can format it according to your needs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 02:30:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347020#M114346</guid>
      <dc:creator>anselmopeixoto</dc:creator>
      <dc:date>2023-06-01T02:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: context getcurrentdate</title>
      <link>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347021#M114347</link>
      <description>&lt;P&gt;@Anselmo Peixoto​&amp;nbsp; @Shicong Hong​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hello , &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;actually the issue is addDate function is retruing date value and  i want to use it in sting format for the query &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i tested it query failed with below &lt;/P&gt;&lt;P&gt;Exception in the component tImpalaLoad_1:ParseException: Syntax error in line 1:&lt;/P&gt;&lt;P&gt;...dn)&amp;nbsp;where&amp;nbsp;date_id = Thu Jun 01 08:13:09 AST 2023&amp;nbsp;an&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my context variable is working fine with current date but i want to add also filter on hour-2 and considering day switching@12AM &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where&amp;nbsp;date_id = "+context.Start_Time+"&amp;nbsp;&lt;B&gt;and hour_id = ???????&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 07:15:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347021#M114347</guid>
      <dc:creator>mshafeeq</dc:creator>
      <dc:date>2023-06-01T07:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: context getcurrentdate</title>
      <link>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347022#M114348</link>
      <description>&lt;P&gt;If im not wrong you have to format it so that it matches the type. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this : &lt;/P&gt;&lt;P&gt;TalendDate.formatDate("YYYY-MM-DD",TalendDate.addDate(TalendDate.getCurrentDate(), -2, "HH"))&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you want something more/less like seconds etc, just change the pattern. And for your other problem, i dont understand what you want to do sorry. &lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 07:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347022#M114348</guid>
      <dc:creator>Lord-Vader</dc:creator>
      <dc:date>2023-06-01T07:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: context getcurrentdate</title>
      <link>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347023#M114349</link>
      <description>&lt;P&gt;Hi @muhamd shafeeq​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TalendDate.formatDate("HH", TalendDate.addDate(TalendDate.getCurrentDate(), -2, "HH")) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formatDate method takes a Date object and returns a String in the format you specify on the first argument, so you can use "HH" as argument to only return the hour from that Date object.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 12:21:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/context-getcurrentdate/m-p/2347023#M114349</guid>
      <dc:creator>anselmopeixoto</dc:creator>
      <dc:date>2023-06-01T12:21:43Z</dc:date>
    </item>
  </channel>
</rss>

