<?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 Then Else resulting in Performance Issue in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Nested-If-Then-Else-resulting-in-Performance-Issue/m-p/1776368#M60187</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;You could try moving the calculations to scripts and create flags , move the measure calculations in script .&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Adi&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2021 14:51:53 GMT</pubDate>
    <dc:creator>AdiPai</dc:creator>
    <dc:date>2021-01-21T14:51:53Z</dc:date>
    <item>
      <title>Nested If Then Else resulting in Performance Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-If-Then-Else-resulting-in-Performance-Issue/m-p/1776326#M60184</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a pivot table with 3 dimension and one measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure calculation consists of nested if else where it checking of each of the dimension and applying set analysis to get count of project code where flag &amp;gt; 0 and then also calculation percentage&lt;/P&gt;&lt;P&gt;With nested if else it takes more than 10 minutes , so i tried pick( match()) : it is taking even more time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can some one help me with solution?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If ( A='XYZ' or B='MNC'&amp;nbsp; ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if( error_type='ABC_EDFG' , count(set_analysis to count the project_code where flag &amp;gt; 0 ) 'and Percentage'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;coun( disticnt.... project code ) / total project code ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;if ,,,,,,,&lt;/P&gt;&lt;P&gt;so on for each of the error type.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 13:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-If-Then-Else-resulting-in-Performance-Issue/m-p/1776326#M60184</guid>
      <dc:creator>shrutipg</dc:creator>
      <dc:date>2021-01-21T13:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Nested If Then Else resulting in Performance Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-If-Then-Else-resulting-in-Performance-Issue/m-p/1776368#M60187</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;You could try moving the calculations to scripts and create flags , move the measure calculations in script .&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Adi&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 14:51:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-If-Then-Else-resulting-in-Performance-Issue/m-p/1776368#M60187</guid>
      <dc:creator>AdiPai</dc:creator>
      <dc:date>2021-01-21T14:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Nested If Then Else resulting in Performance Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-If-Then-Else-resulting-in-Performance-Issue/m-p/1776785#M60227</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;if you dont mine can you share your input, table, expected output with&amp;nbsp; dummy example.&lt;/P&gt;&lt;P&gt;ksrinivasan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 17:39:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-If-Then-Else-resulting-in-Performance-Issue/m-p/1776785#M60227</guid>
      <dc:creator>Ksrinivasan</dc:creator>
      <dc:date>2021-01-22T17:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Nested If Then Else resulting in Performance Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-If-Then-Else-resulting-in-Performance-Issue/m-p/1778891#M60534</link>
      <description>&lt;P&gt;I tried replacing the if then else with addition of each count function and applied the if condition inside of set analysis but some its not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;count( distinct &amp;lt; set analysis ( error_type = 'A')&amp;nbsp; project_code ) + count(distinct &amp;lt;set analysis ( error_type = 'B') project code &amp;gt;)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but here it calculating the sum and then applying to all records irrespective of the error type .&lt;/P&gt;&lt;P&gt;e.g. error type A has count --&amp;gt; 5 and Error_type B has count 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;output&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error Type |&amp;nbsp; &amp;nbsp; Count&amp;nbsp;&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;even thought B is 0 and no condition exists for type C the output is 5 for all records&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please advice, the aim here is to replace if then else for better performance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Original Calculation method&amp;nbsp;&lt;/P&gt;&lt;P&gt;if( error_type = 'A', count(&amp;lt;set analysis&amp;nbsp; flag=0 &amp;gt; project_id) , if ( error_type = 'B', count(&amp;lt;set analysis&amp;nbsp; flag=0 &amp;gt;project_id) ,'')&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note : just the simplified version there are more conditions inside&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 12:10:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-If-Then-Else-resulting-in-Performance-Issue/m-p/1778891#M60534</guid>
      <dc:creator>shrutipg</dc:creator>
      <dc:date>2021-02-01T12:10:22Z</dc:date>
    </item>
  </channel>
</rss>

