<?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: TalendDate function is not working when calling from a external context value file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-function-is-not-working-when-calling-from-a-external/m-p/2207249#M6971</link>
    <description>&lt;P&gt;You cannot use expressions in context variable inputs. It looks a bit like an expression because you can put quotes around it but this is an illusion. All it does is take off any leading or trailing quotes and treat everything else as a literal string.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Dec 2019 10:27:10 GMT</pubDate>
    <dc:creator>PhilHibbs</dc:creator>
    <dc:date>2019-12-16T10:27:10Z</dc:date>
    <item>
      <title>TalendDate function is not working when calling from a external context value file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-function-is-not-working-when-calling-from-a-external/m-p/2207247#M6969</link>
      <description>&lt;P&gt;I am using a tFileOutputDelimited component for a output process.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am using an external context values file to parameterize the values.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Context value file data example:&lt;/P&gt; 
&lt;P&gt;PATH_TGT==//mydoc/share/&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In the&amp;nbsp;tFileOutputDelimited&amp;nbsp; File Name&amp;nbsp; I am also using "&amp;nbsp;"XXX_"+TalendDate.formatDate("yyyyMMdd",TalendDate.getFirstDayOfMonth(TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM"))) + ".txt"" to get the date in the name of the file.&lt;/P&gt; 
&lt;P&gt;So the file output file name is like: XXX_20191210.txt&lt;/P&gt; 
&lt;P&gt;My function is working in the working good inside the talend.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But if i put the TalendDate.formatDate("yyyyMMdd",TalendDate.getFirstDayOfMonth(TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM")))&amp;nbsp; in a context variable I am having error.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Context value file data example:&lt;/P&gt; 
&lt;P&gt;PATH_TGT==//mydoc/share/&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;TGT&lt;/FONT&gt;==TalendDate.formatDate("yyyyMMdd",TalendDate.getFirstDayOfMonth(TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM")))&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Calling the TGT context in inside&amp;nbsp;tFileOutputDelimited file name :&lt;FONT color="#FF0000"&gt; "xxx_" +context.TGT +&amp;nbsp;+ ".txt"&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Error:&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;statistics] connecting to socket on port 3753&lt;BR /&gt;[statistics] connected&lt;BR /&gt;Exception in component tFileOutputDelimited_1 (t_Att_FILE)&lt;BR /&gt;java.io.FileNotFoundException: \\my\ "_" +TalendDate.formatDate("yyyyMMdd",TalendDate.getLastDayOfMonth(TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM"))) + ".txt" (The filename, directory name, or volume label syntax is incorrect)&lt;BR /&gt;at java.io.FileOutputStream.open0(Native Method)&lt;BR /&gt;at java.io.FileOutputStream.open(Unknown Source)&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I know the TalendDate is a builtin function so is it possible to assign the TalendDate function as a context variable?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:52:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-function-is-not-working-when-calling-from-a-external/m-p/2207247#M6969</guid>
      <dc:creator>Tasfiahm</dc:creator>
      <dc:date>2024-11-16T03:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: TalendDate function is not working when calling from a external context value file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-function-is-not-working-when-calling-from-a-external/m-p/2207248#M6970</link>
      <description>&lt;P&gt;It considers TalendDate.formatDate("yyyyMMdd",TalendDate.getFirstDayOfMonth(TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM"))) as a variable value, you can't use any function in the value field.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 06:33:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-function-is-not-working-when-calling-from-a-external/m-p/2207248#M6970</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-16T06:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: TalendDate function is not working when calling from a external context value file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-function-is-not-working-when-calling-from-a-external/m-p/2207249#M6971</link>
      <description>&lt;P&gt;You cannot use expressions in context variable inputs. It looks a bit like an expression because you can put quotes around it but this is an illusion. All it does is take off any leading or trailing quotes and treat everything else as a literal string.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 10:27:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-function-is-not-working-when-calling-from-a-external/m-p/2207249#M6971</guid>
      <dc:creator>PhilHibbs</dc:creator>
      <dc:date>2019-12-16T10:27:10Z</dc:date>
    </item>
  </channel>
</rss>

