<?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 simplification of code in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1814065#M1212825</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to simplify the below code in the script,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if([Object Type Code]='IAV' and LEN(Month)=0, [VEHICLE_STATIC_ID]&amp;amp;'|'&amp;amp;[INVESTOR_ACCOUNT_STATIC_ID]&amp;amp;'|'&amp;amp;Quarter,&lt;BR /&gt;if([Object Type Code]='IAV' and LEN(Quarter)=0, [VEHICLE_STATIC_ID]&amp;amp;'|'&amp;amp;[INVESTOR_ACCOUNT_STATIC_ID]&amp;amp;'|'&amp;amp;Month,&lt;BR /&gt;if([Object Type Code]='IA' and LEN(Month)=0, INVESTOR_ACCOUNT_STATIC_ID&amp;amp;'|'&amp;amp; Quarter,&lt;BR /&gt;if([Object Type Code]='IA' and LEN(Quarter)=0, INVESTOR_ACCOUNT_STATIC_ID&amp;amp;'|'&amp;amp; Month,&lt;BR /&gt;if([Object Type Code]='A' and LEN(Month)=0, ASSET_STATIC_ID&amp;amp;'|'&amp;amp; Quarter,&lt;BR /&gt;if([Object Type Code]='A' and LEN(Quarter)=0, ASSET_STATIC_ID&amp;amp;'|'&amp;amp; Month,&lt;BR /&gt;if([Object Type Code]='V' and LEN(Month)=0, VEHICLE_STATIC_ID&amp;amp;'|'&amp;amp; Quarter,&lt;BR /&gt;if([Object Type Code]='V' and LEN(Quarter)=0, VEHICLE_STATIC_ID&amp;amp;'|'&amp;amp; Month,&lt;BR /&gt;if([Object Type Code]='C' and LEN(Month)=0, COMPOSITE_ID&amp;amp;'|'&amp;amp; Quarter,&lt;BR /&gt;if([Object Type Code]='C' and LEN(Quarter)=0, COMPOSITE_ID&amp;amp;'|'&amp;amp; Month)))))))))) AS KEY_ID,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_Month',%KEY_INVVEH_ID, '-'),'New Investor',&lt;BR /&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_Quarter',%KEY_INVVEH_ID, '-'),'New Investor',&lt;BR /&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_END_Month',%KEY_INVVEH_ID, '-'),'Exiting Investor',&lt;BR /&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_END_Quarter',%KEY_INVVEH_ID, '-'),'Exiting Investor'&lt;BR /&gt;)))) as [Investor New/Exit],&lt;/P&gt;&lt;P&gt;could you please suggest the possible ways for the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jun 2021 11:22:26 GMT</pubDate>
    <dc:creator>deep2021</dc:creator>
    <dc:date>2021-06-15T11:22:26Z</dc:date>
    <item>
      <title>simplification of code</title>
      <link>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1814065#M1212825</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to simplify the below code in the script,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if([Object Type Code]='IAV' and LEN(Month)=0, [VEHICLE_STATIC_ID]&amp;amp;'|'&amp;amp;[INVESTOR_ACCOUNT_STATIC_ID]&amp;amp;'|'&amp;amp;Quarter,&lt;BR /&gt;if([Object Type Code]='IAV' and LEN(Quarter)=0, [VEHICLE_STATIC_ID]&amp;amp;'|'&amp;amp;[INVESTOR_ACCOUNT_STATIC_ID]&amp;amp;'|'&amp;amp;Month,&lt;BR /&gt;if([Object Type Code]='IA' and LEN(Month)=0, INVESTOR_ACCOUNT_STATIC_ID&amp;amp;'|'&amp;amp; Quarter,&lt;BR /&gt;if([Object Type Code]='IA' and LEN(Quarter)=0, INVESTOR_ACCOUNT_STATIC_ID&amp;amp;'|'&amp;amp; Month,&lt;BR /&gt;if([Object Type Code]='A' and LEN(Month)=0, ASSET_STATIC_ID&amp;amp;'|'&amp;amp; Quarter,&lt;BR /&gt;if([Object Type Code]='A' and LEN(Quarter)=0, ASSET_STATIC_ID&amp;amp;'|'&amp;amp; Month,&lt;BR /&gt;if([Object Type Code]='V' and LEN(Month)=0, VEHICLE_STATIC_ID&amp;amp;'|'&amp;amp; Quarter,&lt;BR /&gt;if([Object Type Code]='V' and LEN(Quarter)=0, VEHICLE_STATIC_ID&amp;amp;'|'&amp;amp; Month,&lt;BR /&gt;if([Object Type Code]='C' and LEN(Month)=0, COMPOSITE_ID&amp;amp;'|'&amp;amp; Quarter,&lt;BR /&gt;if([Object Type Code]='C' and LEN(Quarter)=0, COMPOSITE_ID&amp;amp;'|'&amp;amp; Month)))))))))) AS KEY_ID,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_Month',%KEY_INVVEH_ID, '-'),'New Investor',&lt;BR /&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_Quarter',%KEY_INVVEH_ID, '-'),'New Investor',&lt;BR /&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_END_Month',%KEY_INVVEH_ID, '-'),'Exiting Investor',&lt;BR /&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_END_Quarter',%KEY_INVVEH_ID, '-'),'Exiting Investor'&lt;BR /&gt;)))) as [Investor New/Exit],&lt;/P&gt;&lt;P&gt;could you please suggest the possible ways for the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 11:22:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1814065#M1212825</guid>
      <dc:creator>deep2021</dc:creator>
      <dc:date>2021-06-15T11:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: simplification of code</title>
      <link>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1814204#M1212838</link>
      <description>&lt;P&gt;What are you trying to recreate? the whole expression or just creating KEY_ID? If KEY_ID is needed, you can try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Pick(Match([Object Type Code], 'IAV', 'IA', 'A', 'V', 'C'),
[VEHICLE_STATIC_ID]&amp;amp;'|'&amp;amp;[INVESTOR_ACCOUNT_STATIC_ID],
INVESTOR_ACCOUNT_STATIC_ID,
ASSET_STATIC_ID,
VEHICLE_STATIC_ID,
COMPOSITE_ID)
&amp;amp;'|'&amp;amp;
If(LEN(Month)=0, Quarter, Month) as KEY_ID&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Jun 2021 13:35:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1814204#M1212838</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2021-06-10T13:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: simplification of code</title>
      <link>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1814228#M1212844</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the valuable response.&lt;/P&gt;&lt;P&gt;Can you please suggest the possible way for the below part to avoid the repetitive calculation.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_Month',%KEY_INVVEH_ID, '-'),'New Investor',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_Quarter',%KEY_INVVEH_ID, '-'),'New Investor',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_END_Month',%KEY_INVVEH_ID, '-'),'Exiting Investor',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if([PERIOD]=ApplyMap('MAP_INVESTOR_VEHICLE_END_Quarter',%KEY_INVVEH_ID, '-'),'Exiting Investor'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)))) as [Investor New/Exit],&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')&amp;gt;1),'ZERO','NOT ZERO') as STATUS,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')&amp;gt;1),0,BEG_BAL) as BEG_BAL_1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')&amp;gt;1),0,END_BAL) as END_BAL_1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')&amp;gt;1),0,ACTIVITY) as ACTIVITY_1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 14:17:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1814228#M1212844</guid>
      <dc:creator>deep2021</dc:creator>
      <dc:date>2021-06-10T14:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: simplification of code</title>
      <link>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1814253#M1212846</link>
      <description>&lt;P&gt;For the second one, you can try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If(Match([PERIOD], ApplyMap('MAP_INVESTOR_VEHICLE_Month',%KEY_INVVEH_ID, '-'), ApplyMap('MAP_INVESTOR_VEHICLE_Quarter',%KEY_INVVEH_ID, '-')), 'New Investor',
'Exiting Investor') as [Investor New/Exit],&lt;/LI-CODE&gt;&lt;P&gt;Not sure if the next 4 fields can be simplified&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 15:30:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1814253#M1212846</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2021-06-10T15:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: simplification of code</title>
      <link>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1815169#M1212941</link>
      <description>&lt;P&gt;Thanks Sunny for your valuable inputs.&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;Here I am creating flags but can you please assist, how to use pick match when there are multiple conditions.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 11:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/simplification-of-code/m-p/1815169#M1212941</guid>
      <dc:creator>deep2021</dc:creator>
      <dc:date>2021-06-15T11:20:53Z</dc:date>
    </item>
  </channel>
</rss>

