<?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: Extract Date from File Name string in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1766006#M454278</link>
    <description>&lt;P&gt;Hi Edwin,&lt;/P&gt;&lt;P&gt;the addsmonth function in Script returns an error&lt;/P&gt;&lt;P&gt;For the current month scenerio, every month one file is generated with its previous month data. likewise, the QV while it loads, will load all the existing files in the folder. Now I want few objects to only reflect the latest month data only&lt;/P&gt;</description>
    <pubDate>Thu, 03 Dec 2020 13:48:29 GMT</pubDate>
    <dc:creator>arpita</dc:creator>
    <dc:date>2020-12-03T13:48:29Z</dc:date>
    <item>
      <title>Extract Date from File Name string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1765955#M454276</link>
      <description>&lt;P&gt;1st Question:&lt;/P&gt;&lt;P&gt;I have month wise&amp;nbsp; files with name&amp;nbsp;Trades extract for Trade Activity Reports20201027123456789. I used&amp;nbsp;mid(FileName(),46,2)&amp;amp;'/'&amp;amp;mid(FileName(),42,4) as Year_Month and it gives me the month year value perfectly as 10/2020.&lt;/P&gt;&lt;P&gt;But this report is actually of previous month which means, data extracted in Oct is for the month of September. Is there a way to that and also, I want it show as Oct 2020 instead of 10/2020&lt;BR /&gt;&lt;BR /&gt;2nd Question:&lt;/P&gt;&lt;P&gt;My QV has last 3 months data but in few objects, I want only Current month Data. How do I do it&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 11:08:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1765955#M454276</guid>
      <dc:creator>arpita</dc:creator>
      <dc:date>2020-12-03T11:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Date from File Name string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1766003#M454277</link>
      <description>&lt;P&gt;1st question: your file name returns 10/2020 but you want it to return prior month - use the addmonths function and use -1 as the offset.&amp;nbsp; this is assuming you already have extracted the date field&amp;nbsp;&lt;BR /&gt;=addmonths(DATEFIELD,-1)&lt;/P&gt;&lt;P&gt;2nd question is formatting use date(DATEFIELD,'MMM YYYY')&lt;/P&gt;&lt;P&gt;3rd wuestion - first how do you define CURRENT month.&amp;nbsp; you need to be careful here as it is possible your definition might fail at boundary conditions (1st of month especially).&amp;nbsp; if your data is always 1 day behind you may want to test against today()-1&lt;BR /&gt;MONTHSTART(DATEFIELD) = MONTHSTART(today()-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 13:37:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1766003#M454277</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2020-12-03T13:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Date from File Name string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1766006#M454278</link>
      <description>&lt;P&gt;Hi Edwin,&lt;/P&gt;&lt;P&gt;the addsmonth function in Script returns an error&lt;/P&gt;&lt;P&gt;For the current month scenerio, every month one file is generated with its previous month data. likewise, the QV while it loads, will load all the existing files in the folder. Now I want few objects to only reflect the latest month data only&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 13:48:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1766006#M454278</guid>
      <dc:creator>arpita</dc:creator>
      <dc:date>2020-12-03T13:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Date from File Name string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1766072#M454282</link>
      <description>&lt;P&gt;the error in addmonths may be due to the field not being a date field.&amp;nbsp; can you share the expression that created the date field?&amp;nbsp; or are you just getting the year month per above?&amp;nbsp; if so:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;date(addmonths(date(mid(FileName(),46,2)&amp;amp;'/01/'&amp;amp;mid(FileName(),42,4)&amp;nbsp;,'MM/DD/YYYY'),-1),'MMM YYYY') will get you prior month in MMM YYYY format&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if you are loading different months from the data file, you can add a flag in your calendar to flag the current month and use that in your chart or text objects.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 16:06:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1766072#M454282</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2020-12-03T16:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Date from File Name string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1766184#M454292</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/126098"&gt;@arpita&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try like below&lt;/P&gt;&lt;P&gt;=Date(MakeDate(mid('Trades extract for Trade Activity Reports20201027123456789',42,4),mid('Trades extract for Trade Activity Reports20201027123456789',46,2)),'MMM YYYY')&amp;nbsp;&lt;/P&gt;&lt;P&gt;gives Oct 2020&lt;/P&gt;&lt;P&gt;=Date(AddMonths(MakeDate(mid('Trades extract for Trade Activity Reports20201027123456789',42,4),mid('Trades extract for Trade Activity Reports20201027123456789',46,2)),-1),'MMM YYYY') gives Sep 2020&lt;/P&gt;&lt;P&gt;for 2nd, you can create a master calendar and set current month flag and use it.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2020 02:54:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1766184#M454292</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2020-12-04T02:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Date from File Name string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1768361#M454439</link>
      <description>&lt;P&gt;Hi Edwin, This gives me only Dec 2019 for 2 of my files...wich should in actual be Oct 2020 and Nov 2020&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 17:51:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-Date-from-File-Name-string/m-p/1768361#M454439</guid>
      <dc:creator>arpita</dc:creator>
      <dc:date>2020-12-14T17:51:53Z</dc:date>
    </item>
  </channel>
</rss>

