<?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 expression to get the previous month from a date input in TOS in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/expression-to-get-the-previous-month-from-a-date-input-in-TOS/m-p/2359663#M124414</link>
    <description>I am mapping a Date column from Excel to Database. Date column in excel has the value&amp;nbsp;5/1/2016. When I map to a column in Database, it is translating as&amp;nbsp;Sun May 01 00:00:00 MST 2016. The datatype for this column is varchar. From the date 5/1/2016, I want to get the previous month of the date and store that month value in the DB column.&amp;nbsp; 
&lt;BR /&gt;If the date is 5/1/2016 - the month should be "April" 
&lt;BR /&gt;If the date is 6/5/2016 - the month should be "May" and so on. 
&lt;BR /&gt;Is there a Talend expression that can do it? Can some one help me please? 
&lt;BR /&gt;Thanks in advance!</description>
    <pubDate>Sat, 16 Nov 2024 10:35:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T10:35:41Z</dc:date>
    <item>
      <title>expression to get the previous month from a date input in TOS</title>
      <link>https://community.qlik.com/t5/Talend-Studio/expression-to-get-the-previous-month-from-a-date-input-in-TOS/m-p/2359663#M124414</link>
      <description>I am mapping a Date column from Excel to Database. Date column in excel has the value&amp;nbsp;5/1/2016. When I map to a column in Database, it is translating as&amp;nbsp;Sun May 01 00:00:00 MST 2016. The datatype for this column is varchar. From the date 5/1/2016, I want to get the previous month of the date and store that month value in the DB column.&amp;nbsp; 
&lt;BR /&gt;If the date is 5/1/2016 - the month should be "April" 
&lt;BR /&gt;If the date is 6/5/2016 - the month should be "May" and so on. 
&lt;BR /&gt;Is there a Talend expression that can do it? Can some one help me please? 
&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Sat, 16 Nov 2024 10:35:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/expression-to-get-the-previous-month-from-a-date-input-in-TOS/m-p/2359663#M124414</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: expression to get the previous month from a date input in TOS</title>
      <link>https://community.qlik.com/t5/Talend-Studio/expression-to-get-the-previous-month-from-a-date-input-in-TOS/m-p/2359664#M124415</link>
      <description>It depends what you want. You could try using the "addDate" method. To subtract a month, you would just do this... 
&lt;BR /&gt; 
&lt;PRE&gt;date = routines.TalendDate.addDate(date, -1, "MM");&lt;/PRE&gt; 
&lt;BR /&gt;But remember that you will need to know how you want to deal with dates such as "2016/10/31". If you take a month away from that, should you be left with "2016/09/30"? I'm not entirely sure how this would be handled by comparison to subtracting a month from "2016/05/13". Make sure to test these scenarios.</description>
      <pubDate>Wed, 08 Jun 2016 00:18:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/expression-to-get-the-previous-month-from-a-date-input-in-TOS/m-p/2359664#M124415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-08T00:18:25Z</dc:date>
    </item>
  </channel>
</rss>

