<?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 Expression according to multiple conditions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-according-to-multiple-conditions/m-p/1611150#M456459</link>
    <description>&lt;P&gt;This is the expression what i have&lt;/P&gt;&lt;PRE&gt; if(Len([Parent Policy])=0 and UW_YEAR&amp;lt;Year(Today()) , 'new',
if(UW_YEAR&amp;lt;Year(Today()) and Len([Parent Policy])&amp;gt;0 , 'lost', 'renew')
)&lt;/PRE&gt;&lt;P&gt;now i am going to modify this expression&amp;nbsp; according to below conditions&amp;nbsp;&lt;/P&gt;&lt;P&gt;data is like&lt;/P&gt;&lt;PRE&gt;Child_policy parent_policy  from_date    to_Date      Year   Month_Difference Status
12                -          10-7-2019   30-6-2020    2019     1                 Lost&lt;BR /&gt;12                  -         01-8-2019  30-6-2020     2019    1                  Lost&lt;BR /&gt;12                 -           01-8-2019  30-6-2020     2019   1                  Lost&lt;BR /&gt;12                 -             09-6-2019  08-6-2020  2019   12                  Lost&lt;/PRE&gt;&lt;P&gt;this is expression&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(Len([Parent Policy])=0 and UW_YEAR=Year(Today()) , 'new',
if(UW_YEAR&amp;lt;Year(Today()) and Len([Parent Policy])&amp;gt;0 , 'lost', 'renew')
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here i want if from_date and t0_date month difference is below than 12 months then this should be new and if this is above 12 months then status should be lost ..&amp;nbsp;&lt;/P&gt;&lt;P&gt;and with that i want to keep these condition&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if data is like&lt;/P&gt;&lt;PRE&gt;Child policy parent policy Year   Status
12                -         2018   Lost&lt;/PRE&gt;&lt;P&gt;this means that this child policy not exist in current year (2019) and also dont have parent policy (parent policy means this policy not coming from previous year like 2017, 2016 etc ) so this should be lost&lt;/P&gt;&lt;P&gt;if this policy coming from previous year and parent policy is exist then status is renew but if this policy not exist in current year then last record should be lost&lt;/P&gt;&lt;PRE&gt;Child policy parent policy   Year   Status
12                456         2017   renew
124              12           2018   lost&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Aug 2019 13:25:04 GMT</pubDate>
    <dc:creator>capriconuser</dc:creator>
    <dc:date>2019-08-09T13:25:04Z</dc:date>
    <item>
      <title>Expression according to multiple conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-according-to-multiple-conditions/m-p/1611150#M456459</link>
      <description>&lt;P&gt;This is the expression what i have&lt;/P&gt;&lt;PRE&gt; if(Len([Parent Policy])=0 and UW_YEAR&amp;lt;Year(Today()) , 'new',
if(UW_YEAR&amp;lt;Year(Today()) and Len([Parent Policy])&amp;gt;0 , 'lost', 'renew')
)&lt;/PRE&gt;&lt;P&gt;now i am going to modify this expression&amp;nbsp; according to below conditions&amp;nbsp;&lt;/P&gt;&lt;P&gt;data is like&lt;/P&gt;&lt;PRE&gt;Child_policy parent_policy  from_date    to_Date      Year   Month_Difference Status
12                -          10-7-2019   30-6-2020    2019     1                 Lost&lt;BR /&gt;12                  -         01-8-2019  30-6-2020     2019    1                  Lost&lt;BR /&gt;12                 -           01-8-2019  30-6-2020     2019   1                  Lost&lt;BR /&gt;12                 -             09-6-2019  08-6-2020  2019   12                  Lost&lt;/PRE&gt;&lt;P&gt;this is expression&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(Len([Parent Policy])=0 and UW_YEAR=Year(Today()) , 'new',
if(UW_YEAR&amp;lt;Year(Today()) and Len([Parent Policy])&amp;gt;0 , 'lost', 'renew')
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here i want if from_date and t0_date month difference is below than 12 months then this should be new and if this is above 12 months then status should be lost ..&amp;nbsp;&lt;/P&gt;&lt;P&gt;and with that i want to keep these condition&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if data is like&lt;/P&gt;&lt;PRE&gt;Child policy parent policy Year   Status
12                -         2018   Lost&lt;/PRE&gt;&lt;P&gt;this means that this child policy not exist in current year (2019) and also dont have parent policy (parent policy means this policy not coming from previous year like 2017, 2016 etc ) so this should be lost&lt;/P&gt;&lt;P&gt;if this policy coming from previous year and parent policy is exist then status is renew but if this policy not exist in current year then last record should be lost&lt;/P&gt;&lt;PRE&gt;Child policy parent policy   Year   Status
12                456         2017   renew
124              12           2018   lost&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 13:25:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-according-to-multiple-conditions/m-p/1611150#M456459</guid>
      <dc:creator>capriconuser</dc:creator>
      <dc:date>2019-08-09T13:25:04Z</dc:date>
    </item>
  </channel>
</rss>

