<?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: problem with calculating months difference in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/problem-with-calculating-months-difference/m-p/1425542#M805311</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post an example?&lt;/P&gt;&lt;P&gt;Is the Filename correct?&lt;/P&gt;&lt;P&gt;Not quite clear, what you wish to achive with the preceding Date(Date#(-combination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try to check only the inner expression?&lt;/P&gt;&lt;P&gt;MakeDate(mid(FileName(),24,4) ,mid(FileName(),29,2) ,mid(FileName(),32,2))&lt;/P&gt;&lt;P&gt;Does it result in a date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Nov 2017 11:05:23 GMT</pubDate>
    <dc:creator>prieper</dc:creator>
    <dc:date>2017-11-07T11:05:23Z</dc:date>
    <item>
      <title>problem with calculating months difference</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-calculating-months-difference/m-p/1425541#M805310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QV calculated the months difference during the load job and it worked, but both dates were in "columns" =&amp;gt; "Startdate" and "Enddate".&lt;/P&gt;&lt;P&gt;I've used the method from the link: &lt;A href="https://community.qlik.com/docs/DOC-3836" target="_blank"&gt;Calculating Months difference between two dates&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I have to change the startdate ... now the startdate is read from the filename:&lt;/P&gt;&lt;P&gt;($(MonthDiff((Date(Date#(MakeDate(mid(FileName(),24,4) ,mid(FileName(),29,2) ,mid(FileName(),32,2)),'DD.MM.YYYY'))), Enddate))) AS MonthsDifference,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Starting the script the following error message can be read on the screen:&lt;/P&gt;&lt;P&gt;Error in expression:&lt;/P&gt;&lt;P&gt;Mid takes 2-3 parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I fix it? The old method with startdate (in a column) won't be available for me in the future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-calculating-months-difference/m-p/1425541#M805310</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: problem with calculating months difference</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-calculating-months-difference/m-p/1425542#M805311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post an example?&lt;/P&gt;&lt;P&gt;Is the Filename correct?&lt;/P&gt;&lt;P&gt;Not quite clear, what you wish to achive with the preceding Date(Date#(-combination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try to check only the inner expression?&lt;/P&gt;&lt;P&gt;MakeDate(mid(FileName(),24,4) ,mid(FileName(),29,2) ,mid(FileName(),32,2))&lt;/P&gt;&lt;P&gt;Does it result in a date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 11:05:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-calculating-months-difference/m-p/1425542#M805311</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2017-11-07T11:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: problem with calculating months difference</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-calculating-months-difference/m-p/1425543#M805312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, the result is a date. For "reports" in QV the result is ok. I will post an example within the next two hours.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 11:25:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-calculating-months-difference/m-p/1425543#M805312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-07T11:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: problem with calculating months difference</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-calculating-months-difference/m-p/1425544#M805313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOAD MakeDate(mid(FileName(),24,4) ,mid(FileName(),29,2) ,mid(FileName(),32,2)) AS [Report Date],&amp;nbsp; //Date(Date#(MakeDate(mid(FileName(),24,4) ,mid(FileName(),29,2) ,mid(FileName(),32,2)),'DD.MM.YYYY')) AS [Report Date], &lt;/P&gt;&lt;P&gt;MakeDate(mid(FileName(),24,4) ,mid(FileName(),29,2) ,mid(FileName(),32,2)) as %KEY_Kalender_Datum,&amp;nbsp;&amp;nbsp; // Date(Date#(MakeDate(mid(FileName(),24,4) ,mid(FileName(),29,2) ,mid(FileName(),32,2)),'DD.MM.YYYY')) as %KEY_Kalender_Datum,&lt;/P&gt;&lt;P&gt;If (num(mid(FileName(),32,2))='20', 'yes', 'no') as Report.Monthly,&lt;/P&gt;&lt;P&gt;Topic, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Potential Customer], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Account Number (Potential Customer) (Account)], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Est. Close Date] as Report.Close_Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YearName([Est. Close Date]) as Report.Close_Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Est. Close Date] as %KEY_Kalender_Datum2, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Owner, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Territory (Owning User) (User)], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Est. Revenue], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Est. Revenue (Base)], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Weighted Revenue], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Weighted Revenue (Base)],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Probability, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Pipeline Phase], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rating, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Account Category (Account) (Account)], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Industry (Account) (Account)],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ( Status = ('Won') , [Est. Revenue (Base)] , if ( Status = ('Lost'), [Est. Revenue (Base)], [Weighted Revenue (Base)] )) as Reporting.Revenue,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Opportunity ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Actual Close Date],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Actual Revenue],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Actual Revenue (Base)],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //($(MonthDiff(MakeDate(mid(FileName(),24,4) ,mid(FileName(),29,2) ,mid(FileName(),32,2)), [Est. Close Date]))) AS MonthsDifference,&amp;nbsp;&amp;nbsp; //($(MonthDiff([Actual Close Date], [Est. Close Date]))) AS MonthsDifference,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //if( '0' &amp;lt;= ($(MonthDiff([Report Date], [Est. Close Date]))) , if( ($(MonthDiff([Report Date], [Est. Close Date]))) &amp;lt; '19', 'relevant' , 'nrelevant') , 'nrelevant') as Reporting.Pipeline18months,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //if( [Report Date] &amp;lt;= [Est. Close Date] , 'relevant' , 'nrelevant') as Reporting.Pipeline18months,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mid(FileName(),24,4) AS Report.Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mid(FileName(),29,2) AS Report.month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mid(FileName(),32,2) AS Report.day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MakeDate(mid(FileName(),24,4) ,mid(FileName(),29,2) ,mid(FileName(),32,2)) as Report_test.Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'All Opportunities' as Folder&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[\\qlikview\QlikView\ExportDaten\CRM\HD - All Opportunities 201*.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [HD - All Opportunities]);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 13:41:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-calculating-months-difference/m-p/1425544#M805313</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-07T13:41:53Z</dc:date>
    </item>
  </channel>
</rss>

