<?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 Nested if statements and inconsistent data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-if-statements-and-inconsistent-data/m-p/967284#M952488</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;load&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;trim&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0 ,&lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;day&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=15,&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;monthstart&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;monthstart&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,2))))),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;trim&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0 ,&lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;day&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=15,&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;monthstart&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;monthstart&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,2))))),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; )))) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[trial1_due_dt]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; , &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;In this code, if either a K04 or 367 letter is greater than 0 I want to do one of the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If the letter was sent within the first 15 days of the month, increment 1 month and define a&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[trial1_due_dt]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;If the letter was sent after the 15&lt;SUP&gt;th&lt;/SUP&gt;, increment 2 months and do the same&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;Here is what I now need to do.&amp;nbsp; If the Inv_Grp is ‘FHA’&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(if (Match( &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Inv Grp]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'FHA') then do one of the following&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If the letter was sent in the first 20 days of the month, increment 1 month, just like above,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If it was sent after the 20&lt;SUP&gt;th&lt;/SUP&gt; increment 3 months, instead of 2 months as above.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;I have tried several different coding scenarios, the dates are not populating correctly.&amp;nbsp; I end up getting the same dates for both metrics.&amp;nbsp; Here is an example&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;If(len(trim(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0, &lt;BR /&gt; (if (not(Match( &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Inv Grp]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'FHA')),&lt;BR /&gt; (if(day(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=15,date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,2))))),&lt;BR /&gt; if(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; If(len(trim(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0, &lt;BR /&gt; (if (not(Match( &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Inv Grp]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'FHA')),&lt;BR /&gt; (if(day(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=15,date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,2))))),&lt;BR /&gt; if(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp; ,&lt;BR /&gt; If(len(trim(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0, &lt;BR /&gt; (if (Match( &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Inv Grp]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'FHA'),&lt;BR /&gt; (if(day(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=20,date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,3))))),&lt;BR /&gt; if(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; If(len(trim(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0, &lt;BR /&gt; (if (Match( &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Inv Grp]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'FHA'),&lt;BR /&gt; (if(day(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=20,date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,3))))),&lt;BR /&gt; if(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; )))))))))))))))) as &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[trial1_due_dt]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; , &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I&lt;/P&gt;&lt;P&gt;think the issue is my brackets but not sure why it only increments for some entries and not across the entire code.&amp;nbsp; is there a way to streamline this or a best practices when using nested if statements???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Nov 2015 21:39:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-11-23T21:39:45Z</dc:date>
    <item>
      <title>Nested if statements and inconsistent data</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-statements-and-inconsistent-data/m-p/967284#M952488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;load&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;trim&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0 ,&lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;day&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=15,&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;monthstart&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;monthstart&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,2))))),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;trim&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0 ,&lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;day&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=15,&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;monthstart&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;monthstart&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,2))))),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; )))) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[trial1_due_dt]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; , &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;In this code, if either a K04 or 367 letter is greater than 0 I want to do one of the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If the letter was sent within the first 15 days of the month, increment 1 month and define a&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[trial1_due_dt]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;If the letter was sent after the 15&lt;SUP&gt;th&lt;/SUP&gt;, increment 2 months and do the same&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;Here is what I now need to do.&amp;nbsp; If the Inv_Grp is ‘FHA’&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(if (Match( &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Inv Grp]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'FHA') then do one of the following&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If the letter was sent in the first 20 days of the month, increment 1 month, just like above,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If it was sent after the 20&lt;SUP&gt;th&lt;/SUP&gt; increment 3 months, instead of 2 months as above.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;I have tried several different coding scenarios, the dates are not populating correctly.&amp;nbsp; I end up getting the same dates for both metrics.&amp;nbsp; Here is an example&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;If(len(trim(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0, &lt;BR /&gt; (if (not(Match( &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Inv Grp]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'FHA')),&lt;BR /&gt; (if(day(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=15,date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,2))))),&lt;BR /&gt; if(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; If(len(trim(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0, &lt;BR /&gt; (if (not(Match( &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Inv Grp]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'FHA')),&lt;BR /&gt; (if(day(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=15,date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,2))))),&lt;BR /&gt; if(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp; ,&lt;BR /&gt; If(len(trim(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0, &lt;BR /&gt; (if (Match( &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Inv Grp]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'FHA'),&lt;BR /&gt; (if(day(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=20,date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,3))))),&lt;BR /&gt; if(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[K04 Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; If(len(trim(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;))&amp;lt;&amp;gt;0, &lt;BR /&gt; (if (Match( &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Inv Grp]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'FHA'),&lt;BR /&gt; (if(day(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;lt;=20,date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,1))),date(monthstart(addmonths(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,3))))),&lt;BR /&gt; if(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[LM Workout Status Act]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;='IN TRIAL',&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[367]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; )))))))))))))))) as &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[trial1_due_dt]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; , &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I&lt;/P&gt;&lt;P&gt;think the issue is my brackets but not sure why it only increments for some entries and not across the entire code.&amp;nbsp; is there a way to streamline this or a best practices when using nested if statements???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2015 21:39:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-statements-and-inconsistent-data/m-p/967284#M952488</guid>
      <dc:creator />
      <dc:date>2015-11-23T21:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if statements and inconsistent data</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-statements-and-inconsistent-data/m-p/967285#M952489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;I would rewrite your logic using preceding load´s calculating &lt;SPAN style="color: #878787; font-family: arial, sans-serif-light, sans-serif; font-size: small;"&gt;intermediary values that would simply your logic&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14483790404327589 jive_text_macro" jivemacro_uid="_14483790404327589"&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; If(FielTmp and MatchFlag, [367_3months]) as [trial1_due_dt]&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(MatchFlag1,[367_3months]) as FielTmp,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherlogic;&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; [367],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; [K04 Date],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Match( [Inv Grp],'FHA') as MatchFlag1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; date(monthstart(addmonths([367],3))))) as [367_3months]&lt;/P&gt;
&lt;P&gt;from yourqvd.qvd(qvd);&lt;/P&gt;


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2015 15:30:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-statements-and-inconsistent-data/m-p/967285#M952489</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-11-24T15:30:24Z</dc:date>
    </item>
  </channel>
</rss>

