<?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 statement with set analysis doesn't work in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-IF-statement-with-set-analysis-doesn-t-work/m-p/1559419#M742239</link>
    <description>&lt;P&gt;I've solved it!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apart from the mistake in the inline load where I had 'Machine QC' instead of 'Monthly QC', I realised that this part of the first IF statement:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;Count({$-&amp;lt;Description={'ChangeLog Complete'},StringValue={'*'},ProcedureName={'Monthly QC'}&amp;gt;}DateTime)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;always returned &lt;FONT color="#3366FF"&gt;1&lt;/FONT&gt; because if ChangeLog Complete didn't exist, then the number of valid StringValues was 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the second nested IF was never used.&lt;/P&gt;&lt;P&gt;I've revised the IF statement to be&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;=if(Count({$&amp;lt;Description={'ChangeLog Complete'},StringValue={$(vComplete)},ProcedureName={'Monthly QC'}&amp;gt;}DateTime)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;+ Count({$-&amp;lt;Description={'ChangeLog Complete'},StringValue={'*'},ProcedureName={'Monthly QC'}&amp;gt;}DateTime)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;+ Count({$&amp;lt;Description={'Complete?'},StringValue={$(vComplete)},ProcedureName={'Change Log'}&amp;gt;}DateTime)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;+ count({$-&amp;lt;Description={'Complete?'},StringValue={'*'},ProcedureName={'Change Log'}&amp;gt;}DateTime)&amp;gt;1,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;if(count({$&amp;lt;Description={'ChangeLog Complete'}&amp;gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;DateTime)&amp;gt;0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;avg({$&amp;lt;Description={'ChangeLog Complete'}&amp;gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;DateTime),&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;avg({$&amp;lt;Description={'Complete?'}&amp;gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;DateTime)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Can't imagine this will help anyone else, but might as well upload the working file for completeness.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thank you Sunny for looking at this.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2019 09:25:02 GMT</pubDate>
    <dc:creator>_Karen_</dc:creator>
    <dc:date>2019-03-21T09:25:02Z</dc:date>
    <item>
      <title>Nested IF statement with set analysis doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-IF-statement-with-set-analysis-doesn-t-work/m-p/1558971#M742235</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I am having trouble with a nested IF statement with set analysis. Please help!&lt;/P&gt;&lt;P&gt;I have Change Request data that is read from ten separate databases. Each database has the same structure, but in one of the databases the field I am interested in for this table is called something different.&lt;/P&gt;&lt;P&gt;So each Change Log request corresponds to a ResultID and each ResultID has several fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For nine of the databases, the fields I'm interested in have the Description "ChangeLog" and "ChangeLog Complete" and for the tenth, the corresponding fields are "Change Log" and "Complete?" , and it has an extra field which is "Accepted?"&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a variable called vComplete and when I change it, I want the table to show all the Change Requests where "Complete?" or "ChangeLog Complete" match the variable value, &lt;STRONG&gt;but also all the Change Requests where&amp;nbsp;"Complete?" or "ChangeLog Complete" are null.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I've created an example which simulates what i'm doing (attached). In the example, the table titled &lt;EM&gt;"IF Statement #2 only"&lt;/EM&gt; is behaving as expected, but as soon as I try to combine the IF statements into one table - &lt;EM&gt;"Combined IF Statements"&lt;/EM&gt;, it goes wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help gratefully received. Thank you in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Karen&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:06:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-IF-statement-with-set-analysis-doesn-t-work/m-p/1558971#M742235</guid>
      <dc:creator>_Karen_</dc:creator>
      <dc:date>2024-11-16T04:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Nested IF statement with set analysis doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-IF-statement-with-set-analysis-doesn-t-work/m-p/1558991#M742236</link>
      <description>&lt;P&gt;What do you want the "combined if statements" table to look like? I mean what isn't right?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 12:44:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-IF-statement-with-set-analysis-doesn-t-work/m-p/1558991#M742236</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-03-20T12:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Nested IF statement with set analysis doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-IF-statement-with-set-analysis-doesn-t-work/m-p/1559010#M742237</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;Thank you for looking at this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When vComplete = "Yes", I want the table to look like Yes.gif (attached)&lt;/P&gt;&lt;P&gt;When vComplete = "No", I want the table to look like No.gif (also attached)&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it's filtering on "Complete?" and "ChangeLog Complete" but also showing the rows where those values are null.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does that make sense?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best wishes,&lt;/P&gt;&lt;P&gt;KAren&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 13:04:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-IF-statement-with-set-analysis-doesn-t-work/m-p/1559010#M742237</guid>
      <dc:creator>_Karen_</dc:creator>
      <dc:date>2019-03-20T13:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Nested IF statement with set analysis doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-IF-statement-with-set-analysis-doesn-t-work/m-p/1559419#M742239</link>
      <description>&lt;P&gt;I've solved it!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apart from the mistake in the inline load where I had 'Machine QC' instead of 'Monthly QC', I realised that this part of the first IF statement:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;Count({$-&amp;lt;Description={'ChangeLog Complete'},StringValue={'*'},ProcedureName={'Monthly QC'}&amp;gt;}DateTime)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;always returned &lt;FONT color="#3366FF"&gt;1&lt;/FONT&gt; because if ChangeLog Complete didn't exist, then the number of valid StringValues was 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the second nested IF was never used.&lt;/P&gt;&lt;P&gt;I've revised the IF statement to be&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;=if(Count({$&amp;lt;Description={'ChangeLog Complete'},StringValue={$(vComplete)},ProcedureName={'Monthly QC'}&amp;gt;}DateTime)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;+ Count({$-&amp;lt;Description={'ChangeLog Complete'},StringValue={'*'},ProcedureName={'Monthly QC'}&amp;gt;}DateTime)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;+ Count({$&amp;lt;Description={'Complete?'},StringValue={$(vComplete)},ProcedureName={'Change Log'}&amp;gt;}DateTime)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;+ count({$-&amp;lt;Description={'Complete?'},StringValue={'*'},ProcedureName={'Change Log'}&amp;gt;}DateTime)&amp;gt;1,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;if(count({$&amp;lt;Description={'ChangeLog Complete'}&amp;gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;DateTime)&amp;gt;0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;avg({$&amp;lt;Description={'ChangeLog Complete'}&amp;gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;DateTime),&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;avg({$&amp;lt;Description={'Complete?'}&amp;gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;DateTime)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Can't imagine this will help anyone else, but might as well upload the working file for completeness.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thank you Sunny for looking at this.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 09:25:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-IF-statement-with-set-analysis-doesn-t-work/m-p/1559419#M742239</guid>
      <dc:creator>_Karen_</dc:creator>
      <dc:date>2019-03-21T09:25:02Z</dc:date>
    </item>
  </channel>
</rss>

