<?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 Month Difference between Two Dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469423#M1225901</link>
    <description>&lt;P&gt;Hi, I want to calculate month difference between two dates but from what I found out, the formula&amp;nbsp;(Year(A1)*12 + Month(A1)) - (Year(B1)*12 + Month(B1)) will not be correct for all dates. For example as shown below.&lt;/P&gt;
&lt;P&gt;Therefore, kindly advise on how to formula above can be modified to include the date calculation or any expression that can be used for the below.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Example (Correct)&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;A1 = 22 June 2021&lt;/P&gt;
&lt;P&gt;B1 = 19 April 2018&lt;/P&gt;
&lt;P&gt;Month Difference = 38 Months&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Example (Wrong)&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;A1 = 31 August 2023&lt;/P&gt;
&lt;P&gt;B1 = 01 August 2022&lt;/P&gt;
&lt;P&gt;Wrong Month Difference = 12 Months&lt;/P&gt;
&lt;P&gt;Suppose Correct Month Difference = 13 Months&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 07:55:22 GMT</pubDate>
    <dc:creator>MCFH93</dc:creator>
    <dc:date>2024-07-10T07:55:22Z</dc:date>
    <item>
      <title>Month Difference between Two Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469423#M1225901</link>
      <description>&lt;P&gt;Hi, I want to calculate month difference between two dates but from what I found out, the formula&amp;nbsp;(Year(A1)*12 + Month(A1)) - (Year(B1)*12 + Month(B1)) will not be correct for all dates. For example as shown below.&lt;/P&gt;
&lt;P&gt;Therefore, kindly advise on how to formula above can be modified to include the date calculation or any expression that can be used for the below.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Example (Correct)&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;A1 = 22 June 2021&lt;/P&gt;
&lt;P&gt;B1 = 19 April 2018&lt;/P&gt;
&lt;P&gt;Month Difference = 38 Months&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Example (Wrong)&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;A1 = 31 August 2023&lt;/P&gt;
&lt;P&gt;B1 = 01 August 2022&lt;/P&gt;
&lt;P&gt;Wrong Month Difference = 12 Months&lt;/P&gt;
&lt;P&gt;Suppose Correct Month Difference = 13 Months&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 07:55:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469423#M1225901</guid>
      <dc:creator>MCFH93</dc:creator>
      <dc:date>2024-07-10T07:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Month Difference between Two Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469431#M1225902</link>
      <description>&lt;P&gt;Did you try this? "&lt;A href="https://help.qlik.com/en-US/sense/May2024/Subsystems/Hub/Content/Sense_Hub/Scripting/FormattingFunctions/Interval.htm" target="_blank"&gt;Interval - script and chart function | Qlik Sense on Windows Help&lt;/A&gt;"&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 07:57:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469431#M1225902</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2024-07-10T07:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Month Difference between Two Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469444#M1225903</link>
      <description>&lt;P&gt;I have tried and it did not work as intended.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 08:15:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469444#M1225903</guid>
      <dc:creator>MCFH93</dc:creator>
      <dc:date>2024-07-10T08:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Month Difference between Two Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469449#M1225904</link>
      <description>&lt;P&gt;It depends mainly on your definition how the months should be counted - to apply a suitable method.&lt;/P&gt;
&lt;P&gt;Within the above logic you may also add any if-loops to compare the day() of the dates.&lt;/P&gt;
&lt;P&gt;Another approach might be the following logic:&lt;/P&gt;
&lt;P&gt;round((DateA - DateB) / 30)&lt;/P&gt;
&lt;P&gt;Instead of round() you may also consider to use floor() or ceil().&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 08:28:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469449#M1225904</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-07-10T08:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Month Difference between Two Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469628#M1225910</link>
      <description>&lt;P&gt;If you want to count the month when the month# if the same, adjust your expression to add 1 when the month# is the same.&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT face="courier new,courier"&gt;(&lt;SPAN class="s1"&gt;Year&lt;/SPAN&gt;(&lt;SPAN class="s2"&gt;A1&lt;/SPAN&gt;)*12 + &lt;SPAN class="s1"&gt;Month&lt;/SPAN&gt;(&lt;SPAN class="s2"&gt;A1&lt;/SPAN&gt;)) - (&lt;SPAN class="s1"&gt;Year&lt;/SPAN&gt;(&lt;SPAN class="s2"&gt;B1&lt;/SPAN&gt;)*12 + &lt;SPAN class="s1"&gt;Month&lt;/SPAN&gt;(&lt;SPAN class="s2"&gt;B1&lt;/SPAN&gt;)) &lt;STRONG&gt;+ -(&lt;SPAN class="s1"&gt;Month&lt;/SPAN&gt;(&lt;SPAN class="s2"&gt;A1&lt;/SPAN&gt;) = &lt;SPAN class="s1"&gt;Month&lt;/SPAN&gt;(&lt;SPAN class="s2"&gt;B1&lt;/SPAN&gt;))&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 14:54:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Difference-between-Two-Dates/m-p/2469628#M1225910</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2024-07-10T14:54:27Z</dc:date>
    </item>
  </channel>
</rss>

