<?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: help with Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864149#M302447</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An approximation to month difference could also be achieved by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=(vToDate- vFromDate+1) / 30.5&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jul 2015 15:04:52 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2015-07-01T15:04:52Z</dc:date>
    <item>
      <title>help with Expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864147#M302445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two Variables vFromDate &amp;amp; vToDate.&amp;nbsp; My requirement is to find num of months between two variables . &lt;STRONG&gt;I'm writing&amp;nbsp; expression&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=(num(month(vToDate))-num(month(vFromDate)))+1. which works fine as long as year is same . e.g 1/1/2014 - 7/31/2014 . but the minute i change date to different yr e.g 1/1/2013 - 7/31/2014 .. the above expression fails .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I tried another expression &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=num(Date(vToDate))-num(Date(vFromDate))+1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this gives me no of days . so now i need to convert those back to no of months &lt;/P&gt;&lt;P&gt;e.g total no of days is 577 and if converted to month should give me 19 months . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 14:57:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864147#M302445</guid>
      <dc:creator>arusanah</dc:creator>
      <dc:date>2015-07-01T14:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: help with Expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864148#M302446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something like this will help you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14357628749968970 jive_text_macro" jivemacro_uid="_14357628749968970"&gt;
&lt;P&gt;SET DateFormat='DD/MM/YYYY';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;INPUT:&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;, if(day(VisitDay) &amp;gt;= day(DoB),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; mod(MonthIDVisitDay-MonthIDDoB,12),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(mod(MonthIDVisitDay-MonthIDDoB,12)=0,11,mod(MonthIDVisitDay-MonthIDDoB,12)-1)) as AgeMonths&lt;/P&gt;
&lt;P&gt;, if(day(VisitDay) &amp;gt;= day(DoB),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; day(VisitDay)-day(DoB),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; VisitDay-addmonths(DoB,12*AgeYears+if(mod(MonthIDVisitDay-MonthIDDoB,12)=0,11,mod(MonthIDVisitDay-MonthIDDoB,12)-1))) as AgeDays&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;, age(VisitDay,DoB) as AgeYears&lt;/P&gt;
&lt;P&gt;, Year(DoB)*12+Month(DoB) as MonthIDDoB&lt;/P&gt;
&lt;P&gt;, Year(VisitDay)*12+Month(VisitDay) as MonthIDVisitDay&lt;/P&gt;
&lt;P&gt;INLINE [&lt;/P&gt;
&lt;P&gt;DoB, VisitDay&lt;/P&gt;
&lt;P&gt;01/01/2011, 11/03/2012&lt;/P&gt;
&lt;P&gt;01/01/2010, 29/02/2012&lt;/P&gt;
&lt;P&gt;01/03/2010, 29/02/2012&lt;/P&gt;
&lt;P&gt;31/01/2011, 01/02/2011&lt;/P&gt;
&lt;P&gt;28/02/2000, 01/03/2012&lt;/P&gt;
&lt;P&gt;28/02/2000, 01/03/2011&lt;/P&gt;
&lt;P&gt;29/02/2008, 19/02/2012&lt;/P&gt;
&lt;P&gt;14/05/2012, 02/09/2013&lt;/P&gt;
&lt;P&gt;31/01/2013, 30/01/2014&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 15:01:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864148#M302446</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-07-01T15:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: help with Expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864149#M302447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An approximation to month difference could also be achieved by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=(vToDate- vFromDate+1) / 30.5&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 15:04:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864149#M302447</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-07-01T15:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: help with Expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864150#M302448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can calculate the difference in months like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Num(((year(vToDate) * 12) + month(vToDate)) - (((year(vFromDate) * 12) + month(vFromDate))) + 1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 15:17:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864150#M302448</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-07-01T15:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: help with Expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864151#M302449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=num(Month(Vtodate))-num(Month(Vfromdate))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 15:25:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864151#M302449</guid>
      <dc:creator>pratap6699</dc:creator>
      <dc:date>2015-07-01T15:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: help with Expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864152#M302450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much Swuehl, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple , short And perfect&amp;nbsp; solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 16:22:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864152#M302450</guid>
      <dc:creator>arusanah</dc:creator>
      <dc:date>2015-07-01T16:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: help with Expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864153#M302451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Piet , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your Expression was perfect too .. unfortunately i can mark only one as correct answer .. But thank you so much for your help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 16:24:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864153#M302451</guid>
      <dc:creator>arusanah</dc:creator>
      <dc:date>2015-07-01T16:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: help with Expression</title>
      <link>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864154#M302452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to be of help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 16:30:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-with-Expression/m-p/864154#M302452</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-07-01T16:30:31Z</dc:date>
    </item>
  </channel>
</rss>

