<?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: Nested If in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118054#M756829</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;‌will check tomorrow. Don’t have access to the system. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Sep 2018 03:11:33 GMT</pubDate>
    <dc:creator>vishsaggi</dc:creator>
    <dc:date>2018-09-12T03:11:33Z</dc:date>
    <item>
      <title>Nested If</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118048#M756823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following QlikView model:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="GenericDrugEntryDateTwo.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/213305_GenericDrugEntryDateTwo.JPG" style="height: 326px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;I need to add a calculated dimension called "Generic Drug Entry Date".&amp;nbsp; This is calculated on the basis of the following fields:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;DrugSubstanceFlag&lt;/LI&gt;&lt;LI&gt;Patent Expiry Date&lt;/LI&gt;&lt;LI&gt;ExclusivityDate&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;DrugSubstanceFlag takes two values either 'Y' or 'N'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the DrugSubstanceFlag = 'Y' and "Patent Expiry Date" is greater than "ExclusivityDate", then "Generic Drug Entry Date" =&amp;nbsp; "Patent Expiry Date", Otherwise "Generic Drug Entry Date" = "Exclusivity Date".&amp;nbsp; However an item/product denoted by "Trade Name" can have more than two "DrugSubstanceFlag" = 'Y', in this case the higher "Patent Expiry Date" will be the "Generic Drug Entry Date"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the DrugSubstanceFlag = 'N' , then the "Generic Drug Entry Date" is Today's date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting table should look as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="GenericDrugEntryDateThree.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/213306_GenericDrugEntryDateThree.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;There should only be a single Generic Drug Entry Date for each Trade Name entry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i accomplish the above?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&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/Nested-If/m-p/118048#M756823</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Nested If</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118049#M756824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did not understand what you mean by this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"However an item/product denoted by "Trade Name" can have more than two "DrugSubstanceFlag" = 'Y', in this case the higher "Patent Expiry Date" will be the "Generic Drug Entry Date" &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;can you elaborate please. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, for the other conditions you mentioned you can try like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(DrugSubstanceFlag = 'Y' and [Patent Expiry Date] &amp;gt; [ExclusivityDate], [Patent Expiry Date], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(DrugSubstanceFlag = 'Y' and [Patent Expiry Date] &amp;lt; [ExclusivityDate], [Exclusivity Date],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(DrugSubstanceFlag = 'N', Today(), [Generic Drug Entry Date]))) AS GenericDrugEntryDate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2018 18:26:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118049#M756824</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-09-11T18:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Nested If</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118050#M756825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much.&amp;nbsp; I am using a calculated dimension which is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;DrugSubstanceFlag&lt;SPAN style="color: #000000;"&gt; = 'Y' &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;[Patent Expiry Date]&lt;SPAN style="color: #000000;"&gt; &amp;gt; &lt;/SPAN&gt;[ExclusivityDate]&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;DrugSubstanceFlag&lt;SPAN style="color: #000000;"&gt; = ' ' &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;[Patent Expiry Date]&lt;SPAN style="color: #000000;"&gt; &amp;gt; &lt;/SPAN&gt;ExclusivityDate&lt;SPAN style="color: #000000;"&gt;, &lt;/SPAN&gt;[Patent Expiry Date]&lt;SPAN style="color: #000000;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;DrugSubstanceFlag&lt;SPAN style="color: #000000;"&gt; = ' ', &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;Now&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(),&lt;/SPAN&gt;ExclusivityDate&lt;SPAN style="color: #000000;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I get the following table, which is not what i am looking for, dates in the Generic Entry Date column are not dates:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;IMG alt="GenericDrugEntryDateTable.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/213307_GenericDrugEntryDateTable.JPG" style="height: 299px; width: 620px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Chris&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2018 19:56:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118050#M756825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-11T19:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Nested If</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118051#M756826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So just use the Date() function around the expr like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date(yourexpr, 'DD/MM/YYYY')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2018 20:04:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118051#M756826</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-09-11T20:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Nested If</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118052#M756827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your input but does not work in my case&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2018 21:33:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118052#M756827</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-11T21:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Nested If</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118053#M756828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have used the following Calculated Dimension:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;DrugSubstanceFlag&lt;SPAN style="color: #000000;"&gt; = 'Y' &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;[Patent Expiry Date]&lt;SPAN style="color: #000000;"&gt; &amp;gt; &lt;/SPAN&gt;[ExclusivityDate]&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;DrugSubstanceFlag&lt;SPAN style="color: #000000;"&gt; = ' ' &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;[Patent Expiry Date]&lt;SPAN style="color: #000000;"&gt; &amp;gt; &lt;/SPAN&gt;ExclusivityDate&lt;SPAN style="color: #000000;"&gt;, &lt;/SPAN&gt;[Patent Expiry Date]&lt;SPAN style="color: #000000;"&gt;),&lt;/SPAN&gt;ExclusivityDate&lt;SPAN style="color: #000000;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;With the following results&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;IMG alt="GenericDrugEntryDateTable3.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/213329_GenericDrugEntryDateTable3.JPG" style="height: 266px; width: 620px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;The results are almost there &lt;SPAN style="caret-color: #000000;"&gt;but&lt;/SPAN&gt; wrong in the case of the circled data.&amp;nbsp; Expiration date is greater than ExclusivityDate and should therefore be the Generic Entry Date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2018 21:38:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118053#M756828</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-11T21:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Nested If</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118054#M756829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;‌will check tomorrow. Don’t have access to the system. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2018 03:11:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-If/m-p/118054#M756829</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-09-12T03:11:33Z</dc:date>
    </item>
  </channel>
</rss>

