<?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 Help with an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789482#M1028679</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written this expression to find the difference between two dates and then group the records by the number of months difference.&lt;/P&gt;&lt;P&gt;So 0-3 months, 4-6 months, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression seems pretty simplistic.&amp;nbsp; However, when I use this expression in a list box I am not getting the expected results.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example the range 0-3 is also displaying those that return a value of -1.&amp;nbsp; All else is working correctly.&amp;nbsp; I just don't see what is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a dimension to display the results of the formula and that part is working correctly based on the data.&amp;nbsp; The other strange thing is that when I pick one of these ranges from the list box multiple values are highlighted (white) indicating that I have an overlap for some reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if((((((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth)))&amp;gt;=0 AND measure_result='1') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND (((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth))&amp;lt;=3 AND measure_result='1')),'0-3 months',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(((((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth)))&amp;gt;=4 AND measure_result='1') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND (((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth))&amp;lt;=6 AND measure_result='1'),'4-6 months',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(((((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth)))&amp;gt;=7 AND measure_result='1') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND (((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth))&amp;lt;=12 AND measure_result='1'),'7-12 months',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth)))&amp;lt;0 AND measure_result='1','*Due Now*',))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, if there is a better way to do this please let me know.&amp;nbsp; I am new to QlikView and don't understand all of the functions yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Feb 2015 20:34:17 GMT</pubDate>
    <dc:creator>rittermd</dc:creator>
    <dc:date>2015-02-11T20:34:17Z</dc:date>
    <item>
      <title>Help with an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789482#M1028679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written this expression to find the difference between two dates and then group the records by the number of months difference.&lt;/P&gt;&lt;P&gt;So 0-3 months, 4-6 months, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression seems pretty simplistic.&amp;nbsp; However, when I use this expression in a list box I am not getting the expected results.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example the range 0-3 is also displaying those that return a value of -1.&amp;nbsp; All else is working correctly.&amp;nbsp; I just don't see what is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a dimension to display the results of the formula and that part is working correctly based on the data.&amp;nbsp; The other strange thing is that when I pick one of these ranges from the list box multiple values are highlighted (white) indicating that I have an overlap for some reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if((((((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth)))&amp;gt;=0 AND measure_result='1') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND (((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth))&amp;lt;=3 AND measure_result='1')),'0-3 months',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(((((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth)))&amp;gt;=4 AND measure_result='1') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND (((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth))&amp;lt;=6 AND measure_result='1'),'4-6 months',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(((((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth)))&amp;gt;=7 AND measure_result='1') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND (((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth))&amp;lt;=12 AND measure_result='1'),'7-12 months',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((((YEAR(DueDate)-PeriodYear)*12+(MONTH(DueDate)-PeriodMonth)))&amp;lt;0 AND measure_result='1','*Due Now*',))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, if there is a better way to do this please let me know.&amp;nbsp; I am new to QlikView and don't understand all of the functions yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 20:34:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789482#M1028679</guid>
      <dc:creator>rittermd</dc:creator>
      <dc:date>2015-02-11T20:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789483#M1028680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post your data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 22:36:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789483#M1028680</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2015-02-11T22:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789484#M1028681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There has to be a simpler way of calculating this one, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(DueDate &amp;gt; AddMonths(CurrentDate, -3) and DueDate &amp;lt;= CurrentDate, '0-3 months',&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;IF(DueDate &amp;gt; AddMonths(CurrentDate, -6) and DueDate &amp;lt;= &lt;SPAN style="font-size: 13.3333330154419px;"&gt;AddMonths(CurrentDate, -3) &lt;/SPAN&gt;, '0-3 months',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may be reversing the direction, but this is the general direction. If you want to compare whole months, you may use MonthStart() with one or both dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's always much easier to perform date math with dates fields than tinker with Years and Months separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;Come and learn Set Analysis and Advanced Aggregation with me at www.masterssummit.com - take your QlikView skills to the next level!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 23:32:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789484#M1028681</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2015-02-11T23:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789485#M1028682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Part of the problem is that one field is a date and the other is just YYYYMM.&amp;nbsp; So I have to break the YYYYMM into its parts and then calculate against the year and month in the date field.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 00:41:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789485#M1028682</guid>
      <dc:creator>rittermd</dc:creator>
      <dc:date>2015-02-12T00:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help with an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789486#M1028683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mark, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can easily convert that to a date. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MakeDate(Year, Month) will generate a date corresponding to the beginning of the same month.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 00:55:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/789486#M1028683</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2015-02-12T00:55:32Z</dc:date>
    </item>
  </channel>
</rss>

