<?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 condition simplification in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-if-condition-simplification/m-p/1815374#M1212975</link>
    <description>&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;Please have a look on the below part.&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;if( len(Month)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((LEFT((num#(Month)),4)='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'CAL1' ,&lt;BR /&gt;IF( (LEFT((num#(Month)),4)&amp;lt;='2009'), 'CAL1'))),&lt;BR /&gt;&lt;BR /&gt;if(len(Quarter)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((NUM#(LEFT(Quarter,4))='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'CAL1',&lt;BR /&gt;if( (NUM#(LEFT(Quarter,4))&amp;lt;='2009'),'CAL1'))))) as PLSR_CAL_HISTORIC,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if([Object Type Code] ='A' AND ((LEFT((num#(Month)),4)&amp;lt;='2010') OR (NUM#(LEFT(Quarter,4))&amp;lt;='2010')) and&lt;BR /&gt;// (ASSET_STATIC_ID='10649' or ASSET_STATIC_ID='10650' or ASSET_STATIC_ID='10651' or ASSET_STATIC_ID='10660'),'RTN',&lt;BR /&gt;wildmatch(ASSET_STATIC_ID,'10649','10650','10651','10660'),'RTN',&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if( len(Month)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((LEFT((num#(Month)),4)='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'CAL1',&lt;BR /&gt;IF( (LEFT((num#(Month)),4)&amp;lt;='2009'), 'CAL1'))),&lt;BR /&gt;&lt;BR /&gt;if(len(Quarter)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((NUM#(LEFT(Quarter,4))='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'CAL1',&lt;BR /&gt;if( (NUM#(LEFT(Quarter,4))&amp;lt;='2009'),'CAL1')))))) as ILSR_CAL_HISTORIC,&lt;BR /&gt;&lt;BR /&gt;if([Object Type Code] ='A' AND ((LEFT((num#(Month)),4)&amp;lt;='2010') OR (NUM#(LEFT(Quarter,4))&amp;lt;='2010')) and&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;wildmatch(ASSET_STATIC_ID,'10649','10650','10651','10660'),'TOTAL FOR RTN',&lt;BR /&gt;&lt;BR /&gt;//(ASSET_STATIC_ID='10649' or ASSET_STATIC_ID='10650' or ASSET_STATIC_ID='10651' or ASSET_STATIC_ID='10660'),'TOTAL FOR RTN',&lt;BR /&gt;&lt;BR /&gt;if( len(Month)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((LEFT((num#(Month)),4)='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'TOTAL FOR NON-RTN',&lt;BR /&gt;IF( (LEFT((num#(Month)),4)&amp;lt;='2009'), 'TOTAL FOR NON-RTN'))),&lt;BR /&gt;&lt;BR /&gt;if(len(Quarter)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((NUM#(LEFT(Quarter,4))='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'TOTAL FOR NON-RTN',&lt;BR /&gt;if( (NUM#(LEFT(Quarter,4))&amp;lt;='2009'),'TOTAL FOR NON-RTN')))))) as ILSR_CAL_HISTORIC2&lt;/P&gt;&lt;P&gt;from t1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please suggest how to simplify&amp;nbsp; and reduce the above mentioned code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jun 2021 05:37:02 GMT</pubDate>
    <dc:creator>deep2021</dc:creator>
    <dc:date>2021-06-16T05:37:02Z</dc:date>
    <item>
      <title>Nested if condition simplification</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-condition-simplification/m-p/1815374#M1212975</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;Please have a look on the below part.&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;if( len(Month)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((LEFT((num#(Month)),4)='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'CAL1' ,&lt;BR /&gt;IF( (LEFT((num#(Month)),4)&amp;lt;='2009'), 'CAL1'))),&lt;BR /&gt;&lt;BR /&gt;if(len(Quarter)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((NUM#(LEFT(Quarter,4))='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'CAL1',&lt;BR /&gt;if( (NUM#(LEFT(Quarter,4))&amp;lt;='2009'),'CAL1'))))) as PLSR_CAL_HISTORIC,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if([Object Type Code] ='A' AND ((LEFT((num#(Month)),4)&amp;lt;='2010') OR (NUM#(LEFT(Quarter,4))&amp;lt;='2010')) and&lt;BR /&gt;// (ASSET_STATIC_ID='10649' or ASSET_STATIC_ID='10650' or ASSET_STATIC_ID='10651' or ASSET_STATIC_ID='10660'),'RTN',&lt;BR /&gt;wildmatch(ASSET_STATIC_ID,'10649','10650','10651','10660'),'RTN',&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if( len(Month)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((LEFT((num#(Month)),4)='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'CAL1',&lt;BR /&gt;IF( (LEFT((num#(Month)),4)&amp;lt;='2009'), 'CAL1'))),&lt;BR /&gt;&lt;BR /&gt;if(len(Quarter)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((NUM#(LEFT(Quarter,4))='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'CAL1',&lt;BR /&gt;if( (NUM#(LEFT(Quarter,4))&amp;lt;='2009'),'CAL1')))))) as ILSR_CAL_HISTORIC,&lt;BR /&gt;&lt;BR /&gt;if([Object Type Code] ='A' AND ((LEFT((num#(Month)),4)&amp;lt;='2010') OR (NUM#(LEFT(Quarter,4))&amp;lt;='2010')) and&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;wildmatch(ASSET_STATIC_ID,'10649','10650','10651','10660'),'TOTAL FOR RTN',&lt;BR /&gt;&lt;BR /&gt;//(ASSET_STATIC_ID='10649' or ASSET_STATIC_ID='10650' or ASSET_STATIC_ID='10651' or ASSET_STATIC_ID='10660'),'TOTAL FOR RTN',&lt;BR /&gt;&lt;BR /&gt;if( len(Month)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((LEFT((num#(Month)),4)='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'TOTAL FOR NON-RTN',&lt;BR /&gt;IF( (LEFT((num#(Month)),4)&amp;lt;='2009'), 'TOTAL FOR NON-RTN'))),&lt;BR /&gt;&lt;BR /&gt;if(len(Quarter)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;&lt;BR /&gt;if( ((NUM#(LEFT(Quarter,4))='2010') AND (ApplyMap('PLSR_HISTORIC',VEHICLE_STATIC_ID)='REIT')),'TOTAL FOR NON-RTN',&lt;BR /&gt;if( (NUM#(LEFT(Quarter,4))&amp;lt;='2009'),'TOTAL FOR NON-RTN')))))) as ILSR_CAL_HISTORIC2&lt;/P&gt;&lt;P&gt;from t1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please suggest how to simplify&amp;nbsp; and reduce the above mentioned code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 05:37:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-condition-simplification/m-p/1815374#M1212975</guid>
      <dc:creator>deep2021</dc:creator>
      <dc:date>2021-06-16T05:37:02Z</dc:date>
    </item>
  </channel>
</rss>

