<?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: Handling conditional flow in Load Script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Handling-conditional-flow-in-Load-Script/m-p/1814087#M66541</link>
    <description>&lt;P&gt;Hi, the most straightforward way I can think of is joining all the tables and the generating a final table with the values you need. Supposing the 3 tables are loaded previously in the script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;join(X) 
LOAD p as a, 
q,r,s 
Resident Y; 

join(X) 
LOAD x as a, 
y,z 
Resident Z; 

FinalX: 
Load a,b,c, 
if(q='yes',r,y) as column4, 
if(q='yes',s,z) as column5 
Resident X; 

drop tables X,Y,Z&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another way this could be easily done is with ApplyMap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jun 2021 08:22:49 GMT</pubDate>
    <dc:creator>pabloviera</dc:creator>
    <dc:date>2021-06-10T08:22:49Z</dc:date>
    <item>
      <title>Handling conditional flow in Load Script</title>
      <link>https://community.qlik.com/t5/App-Development/Handling-conditional-flow-in-Load-Script/m-p/1814042#M66530</link>
      <description>&lt;P&gt;I have tables Tab_X, Tab_Y, Tab_Z&lt;/P&gt;&lt;P&gt;Table Tab_X has columns -&amp;gt; a,b,c ( Table Tab_X is going to be the main/primary table)&lt;/P&gt;&lt;P&gt;Table Tab_Y has columns -&amp;gt; p,q,r,s&lt;/P&gt;&lt;P&gt;Table Tab_Z has columns -&amp;gt; x,y,z&lt;/P&gt;&lt;P&gt;The requirement is to have all the rows of Tab_X and use the columns from Tab_Y and Tab_Z based on IF conditions&lt;/P&gt;&lt;P&gt;Say Tab_X has 1000 rows&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Left join Tab_X with&amp;nbsp;Tab_Y&amp;nbsp; on&amp;nbsp;Tab_X .a =&amp;nbsp;Tab_Y .p&amp;nbsp;&amp;nbsp;and if value of q is "yes", then use columns r,s. If value of q is “no” then don’t use values from these columns&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Eg. If 700 rows in Tab_X match with Tab_Y&amp;nbsp;the result would be, i.e. Tab_X would have columns&amp;nbsp; a,b,c,r,s&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For the remaining 300 rows, join with Tab_Z on Tab_X.a= Tab_Z.x and use values from the columns y,z&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Tab_X would have 5 columns in total where the values for the last two columns are pulled from Either Tab_X or Tab_Y based on condition&lt;/P&gt;&lt;P&gt;How to do this in Load Script ? Because this is just an example and I must apply the logic for 5 tables and multiple IF conditions.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 04:05:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Handling-conditional-flow-in-Load-Script/m-p/1814042#M66530</guid>
      <dc:creator>lost_rabbit</dc:creator>
      <dc:date>2021-06-10T04:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Handling conditional flow in Load Script</title>
      <link>https://community.qlik.com/t5/App-Development/Handling-conditional-flow-in-Load-Script/m-p/1814087#M66541</link>
      <description>&lt;P&gt;Hi, the most straightforward way I can think of is joining all the tables and the generating a final table with the values you need. Supposing the 3 tables are loaded previously in the script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;join(X) 
LOAD p as a, 
q,r,s 
Resident Y; 

join(X) 
LOAD x as a, 
y,z 
Resident Z; 

FinalX: 
Load a,b,c, 
if(q='yes',r,y) as column4, 
if(q='yes',s,z) as column5 
Resident X; 

drop tables X,Y,Z&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another way this could be easily done is with ApplyMap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:22:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Handling-conditional-flow-in-Load-Script/m-p/1814087#M66541</guid>
      <dc:creator>pabloviera</dc:creator>
      <dc:date>2021-06-10T08:22:49Z</dc:date>
    </item>
  </channel>
</rss>

