<?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 Assign Multiple Columns After an IF....Else in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Assign-Multiple-Columns-After-an-IF-Else/m-p/1661019#M49665</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to Convert Excel code into Qliksense and i'm trying to do the following within a preceding load statement:&lt;/P&gt;&lt;P&gt;Load*,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if Len(Var1&amp;gt;0) then&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1 as Col1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;elseif Len(Var2&amp;gt;0) then&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if IsNum(Var2) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if Var2 &amp;gt; 0 Then&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var2 as Col2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var3 as Col3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end if&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;end if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Load ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FROM source;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also know you cant do if...THEN within a load statement. So, my question is, is there another way to achieve similar result in Qliksense? Your help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 19:22:53 GMT</pubDate>
    <dc:creator>waleeed_mahmood</dc:creator>
    <dc:date>2024-11-16T19:22:53Z</dc:date>
    <item>
      <title>Assign Multiple Columns After an IF....Else</title>
      <link>https://community.qlik.com/t5/App-Development/Assign-Multiple-Columns-After-an-IF-Else/m-p/1661019#M49665</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to Convert Excel code into Qliksense and i'm trying to do the following within a preceding load statement:&lt;/P&gt;&lt;P&gt;Load*,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if Len(Var1&amp;gt;0) then&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1 as Col1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;elseif Len(Var2&amp;gt;0) then&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if IsNum(Var2) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if Var2 &amp;gt; 0 Then&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var2 as Col2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var3 as Col3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end if&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;end if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Load ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FROM source;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also know you cant do if...THEN within a load statement. So, my question is, is there another way to achieve similar result in Qliksense? Your help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:22:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assign-Multiple-Columns-After-an-IF-Else/m-p/1661019#M49665</guid>
      <dc:creator>waleeed_mahmood</dc:creator>
      <dc:date>2024-11-16T19:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Assign Multiple Columns After an IF....Else</title>
      <link>https://community.qlik.com/t5/App-Development/Assign-Multiple-Columns-After-an-IF-Else/m-p/1661029#M49666</link>
      <description>&lt;P&gt;May be this way?&lt;/P&gt;&lt;P&gt;if Len(Var1&amp;gt;0) then&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Var1 as Col1 Autogenerate ($(Var1));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;elseif Len(Var2&amp;gt;0) then&lt;/P&gt;&lt;P&gt;if IsNum(Var2) Then&lt;/P&gt;&lt;P&gt;if Var2 &amp;gt; 0 Then&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Var2 as Col2 Autogenerate ($(Var2));;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Var3 as Col3 Autogenerate ($(Var2));;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 14:33:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assign-Multiple-Columns-After-an-IF-Else/m-p/1661029#M49666</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2019-12-27T14:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Assign Multiple Columns After an IF....Else</title>
      <link>https://community.qlik.com/t5/App-Development/Assign-Multiple-Columns-After-an-IF-Else/m-p/1661060#M49667</link>
      <description>&lt;P&gt;Hey Anil,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply. Im sorry i dont understand why you are using AutoGenerate($(Var)). Could you please explain?&lt;/P&gt;&lt;P&gt;Following is my code from my script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; if Len(ApplyMap('L2NPoRMap',CompoundKey_2)) &amp;gt; 0 then
	Load *,
    $(cOnRequestPrice) as FL2NP
    Resident Material_Master_Table;
    
 elseif (Len(ApplyMap('StandardPriceNPMap',CompoundKey_2))&amp;gt; 0 ) then 
    Load *,
    ApplyMap('StandardPriceNPMap',CompoundKey_2) as FL2NP,
    ApplyMap('StandardPriceNPMap',CompoundKey_2) as FL2NPOverRide
    Resident Material_Master_Table;
 
 elseif Len(FL1NPoR) &amp;gt; 0 Then // FL1NPoR is a field inside Material_Master_Table
 	Load *,
    $(cOnRequestPrice) as FL2NP
    Resident Material_Master_Table;
 
 elseif(Len(FL1NP) &amp;gt; 0 AND IsNum(FL1NP) AND FL1NP &amp;gt; 0) then // FL1NP is a field inside Material_Master_Table
 	Load *,
    FL1NP * ApplyMap('FacMap',CompoundKey_2) as FL2NP
    Resident Material_Master_Table;
 
 end if&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I'm new to Qlik so im not sure how qlik handles the iterations. So, my questions are as follows if someone is kind enough to answer:&lt;/P&gt;&lt;P&gt;1: Will the 2nd &lt;STRONG&gt;elseif&amp;nbsp;&lt;/STRONG&gt;go through my entire table or just the first row?&lt;/P&gt;&lt;P&gt;2: CompoundKey_2 is a field inside Material_Master_Table, am i allowed to use that field outside of the load statement?&lt;/P&gt;&lt;P&gt;3: The first elseif should return the length as 1 because my data has a value of '0' in it which is lenght 1. However, it doesnt return anything, just NULL. why might that be the case?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 16:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assign-Multiple-Columns-After-an-IF-Else/m-p/1661060#M49667</guid>
      <dc:creator>waleeed_mahmood</dc:creator>
      <dc:date>2019-12-27T16:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Assign Multiple Columns After an IF....Else</title>
      <link>https://community.qlik.com/t5/App-Development/Assign-Multiple-Columns-After-an-IF-Else/m-p/1661068#M49668</link>
      <description>&lt;P&gt;Sorry idk why my reply was removed from this post.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Following is the excel code im trying to convert to Qlik" style="width: 631px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/26098i1101DA73EFEE8F42/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Following is the excel code im trying to convert to Qlik" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Following is the excel code im trying to convert to Qlik&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;my script so far in Qlik:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if Len(ApplyMap('L2NPoRMap',CompoundKey_2)) &amp;gt; 0 then
	Load *,
    $(cOnRequestPrice) as FL2NP
    Resident Material_Master_Table;
    
 elseif (Len(ApplyMap('StandardPriceNPMap',CompoundKey_2))&amp;gt; 0 ) then 
    Load *,
    ApplyMap('StandardPriceNPMap',CompoundKey_2) as FL2NP,
    ApplyMap('StandardPriceNPMap',CompoundKey_2) as FL2NPOverRide
    Resident Material_Master_Table;
 
 elseif Len(FL1NPoR) &amp;gt; 0 Then // FL1NPoR is a field inside Material_Master_Table
 	Load *,
    $(cOnRequestPrice) as FL2NP
    Resident Material_Master_Table;
 
 elseif(Len(FL1NP) &amp;gt; 0 AND IsNum(FL1NP) AND FL1NP &amp;gt; 0) then // FL1NP is a field inside Material_Master_Table
 	Load *,
    $(cOnRequestPrice) as FL2NP
    Resident Material_Master_Table;
 
 end if&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Questions:&lt;/P&gt;&lt;P&gt;1: Will the second Elseif iterate through my entire table or just the first row?&lt;/P&gt;&lt;P&gt;2: CompoundKey_2 is a field in Materail_Master_Table, am i using it right?&lt;/P&gt;&lt;P&gt;3: My first elseif should return the lenght of 1 because my data hold a value of 0. However, it is returning NULL. Any idea why that might be the case?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please and thank you for helping.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 16:27:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assign-Multiple-Columns-After-an-IF-Else/m-p/1661068#M49668</guid>
      <dc:creator>waleeed_mahmood</dc:creator>
      <dc:date>2019-12-27T16:27:25Z</dc:date>
    </item>
  </channel>
</rss>

