<?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: Simplifying if conditions in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Simplifying-if-conditions-in-the-script/m-p/1814955#M1212917</link>
    <description>&lt;P&gt;Hi Markus,&lt;/P&gt;&lt;P&gt;Thanks for your valuable inputs. These calculation belongs to same table and there are number of if conditions. In that case if we can use where clause for the if condition does that makes any sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Jun 2021 15:03:14 GMT</pubDate>
    <dc:creator>deep2021</dc:creator>
    <dc:date>2021-06-14T15:03:14Z</dc:date>
    <item>
      <title>Simplifying if conditions in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Simplifying-if-conditions-in-the-script/m-p/1814576#M1212884</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PFB script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please suggest how to simplify if statement from the script.&lt;/P&gt;&lt;P&gt;if(ApplyMap('AcquisitionMonth',ASSET_STATIC_ID,null())=Month, ApplyMap('AcquisitionMonth',ASSET_STATIC_ID,null()),null()) as ASSET_ACQUISITION_MONTH,&lt;BR /&gt;if(ApplyMap('AcquisitionQuarter',ASSET_STATIC_ID,null())=Quarter, ApplyMap('AcquisitionQuarter',ASSET_STATIC_ID,null()),null()) as ASSET_ACQUISITION_QUARTER,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if( len(Month)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;ApplyMap('DispositionMonth',[%KEY_ASSET_SCD],'-')),&lt;BR /&gt;if(len(Quarter)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;ApplyMap('DispositionQuarter',[%KEY_ASSET_SCD],'-')))) as PropertySold_Diversification,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if(len(Month)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;ApplyMap('DispositionMonth_asset',[%KEY_ASSET_SCD],'-')),&lt;BR /&gt;if(len(Quarter)&amp;gt;2 and [Object Type Code]='A',(&lt;BR /&gt;ApplyMap('DispositionQuarter_asset',[%KEY_ASSET_SCD],'-')))) as PropertySold_Asset_download,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if( len(Quarter)&amp;gt;2,(&lt;BR /&gt;if(((Applymap('On_Off_Rules_Start_Qtr_MVRF',VEHICLE_STATIC_ID,'')&amp;lt;= Replace(Quarter,'Q','')) and&lt;BR /&gt;(Replace(Quarter,'Q','')&amp;lt;= Applymap('On_Off_Rules_End_Qtr_MVRF',VEHICLE_STATIC_ID))),'PL_OFF','0')&lt;BR /&gt;),&lt;BR /&gt;if( len(Month)&amp;gt;2,(&lt;BR /&gt;if(((Applymap('On_Off_Rules_Start_Mth_MVRF',VEHICLE_STATIC_ID,'')&amp;lt;= (num#(Month))) and&lt;BR /&gt;((num#(Month))&amp;lt;= Applymap('On_Off_Rules_End_Mth_MVRF',VEHICLE_STATIC_ID))),'PL_OFF','0')))) as PL_OFF,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if( len(Quarter)&amp;gt;2,(&lt;BR /&gt;if((((Applymap('On_Off_Rules_Start_Qtr_NAV',VEHICLE_STATIC_ID,'')&amp;lt;= Replace(Quarter,'Q','')) and&lt;BR /&gt;(Replace(Quarter,'Q','')&amp;lt;= Applymap('On_Off_Rules_End_Qtr_NAV',VEHICLE_STATIC_ID)))) ,'IL_OFF','0')&lt;BR /&gt;),&lt;BR /&gt;if( len(Month)&amp;gt;2,(&lt;BR /&gt;if((((Applymap('On_Off_Rules_Start_Mth_NAV',VEHICLE_STATIC_ID,'')&amp;lt;= (num#(Month))) and&lt;BR /&gt;((num#(Month))&amp;lt;= Applymap('On_Off_Rules_End_Mth_NAV',VEHICLE_STATIC_ID)))),'IL_OFF','0')))) as IL_OFF,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 17:05:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simplifying-if-conditions-in-the-script/m-p/1814576#M1212884</guid>
      <dc:creator>deep2021</dc:creator>
      <dc:date>2021-06-11T17:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying if conditions in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Simplifying-if-conditions-in-the-script/m-p/1814818#M1212902</link>
      <description>&lt;P&gt;It's difficult to suggest how this might be simplified and/or optimized. Things which are noticeable are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;the applymap() are executed twice within the if-loop - this may not mandatory necessary else the default-value from applymap() may be enough&lt;/LI&gt;&lt;LI&gt;like recommended in the previous posting the mapping might be done within the first load and checks and any deducing from the results may be applied within a preceeding load of it&lt;/LI&gt;&lt;LI&gt;there are replace() and converting measures within the if-loops which may not necessary at all and/or be resolved within working-steps in beforehand&lt;/LI&gt;&lt;LI&gt;multiple different calendar-fields may be associated with own calendars and/or canonical calendars instead of embedding them&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Beside this the script-snippets look like as if a lot of fields are - rather complex - created. It reminds me a bit of approaches which would be needed within a table-calculation. Within databases and/or BI tools like Qlik is it the aim to work rather on table-levels to transform and merge the needed information as to extend the logics from&amp;nbsp;a table-calculation. Although this is in general possible it's not optimized in regard to the performance and also not to the efforts to develop and maintain such logics. Therefore here - changing the general approach how to develop the datamodels - may more potential as within the suggestions above.&lt;/P&gt;&lt;P&gt;- Marcus&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 09:08:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simplifying-if-conditions-in-the-script/m-p/1814818#M1212902</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-06-14T09:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying if conditions in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Simplifying-if-conditions-in-the-script/m-p/1814955#M1212917</link>
      <description>&lt;P&gt;Hi Markus,&lt;/P&gt;&lt;P&gt;Thanks for your valuable inputs. These calculation belongs to same table and there are number of if conditions. In that case if we can use where clause for the if condition does that makes any sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 15:03:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simplifying-if-conditions-in-the-script/m-p/1814955#M1212917</guid>
      <dc:creator>deep2021</dc:creator>
      <dc:date>2021-06-14T15:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Simplifying if conditions in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Simplifying-if-conditions-in-the-script/m-p/1815113#M1212938</link>
      <description>&lt;P&gt;If the dataset should be reduced in any way it should be done as early as possible because the following loadings and transformation would be performed against as smaller dataset.&lt;/P&gt;&lt;P&gt;Like above hinted not every if-loop might be necessary if they are applied on top of each other and maybe als within multipler more particular loadings which are afterwards merged again.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 08:28:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simplifying-if-conditions-in-the-script/m-p/1815113#M1212938</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-06-15T08:28:55Z</dc:date>
    </item>
  </channel>
</rss>

