<?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 if statement error upon loading app script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/if-statement-error-upon-loading-app-script/m-p/1820822#M67290</link>
    <description>&lt;P&gt;my if statement is failing, but I'm not sure why&lt;BR /&gt;&lt;BR /&gt;Here is my statement:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(Single_asset_only_assigned + Single_asset_only_derived = 1, 
    if(len(asset_class_assigned)&amp;gt;0, asset_class_assigned, asset_class_derived),
    if(Single_asset_only_assigned + Single_asset_only_derived = 2, 
        if(Single_asset_only_assigned = Single_asset_only_derived, asset_class_assigned,'')
    ,'')
) as "combo.Name of all asset classes"&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;the second "if" is highlighted&amp;nbsp;in red but I&amp;nbsp;cant seem to find anything wrong with the statement.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;getting the following message when script runs:&lt;BR /&gt;&lt;BR /&gt;The following error occurred:&lt;BR /&gt;Unexpected token: 'if', expected one of: ',', 'Inline', 'AutoGenerate', 'From', 'From_Field', 'Resident', 'Extension', ...&lt;BR /&gt;The error occurred here:&lt;BR /&gt;combo:&lt;BR /&gt;Load Distinct&lt;BR /&gt;*&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;if&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;(combo.Single_asset_only_assigned + combo.Single_asset_only_derived = 1, if(len(combo.asset_class_assigned)&amp;gt;0, combo.asset_class_assigned, combo.asset_class_derived),&lt;BR /&gt;if(combo.Single_asset_only_assigned + combo.Single_asset_only_derived = 2, if(combo.Single_asset_only_assigned = combo.Single_asset_only_derived, combo.asset_class_assigned,''),'')) as "combo.Name of all asset classes"&lt;BR /&gt;Resident combo_temp&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jul 2021 20:25:50 GMT</pubDate>
    <dc:creator>Panv</dc:creator>
    <dc:date>2021-07-08T20:25:50Z</dc:date>
    <item>
      <title>if statement error upon loading app script</title>
      <link>https://community.qlik.com/t5/App-Development/if-statement-error-upon-loading-app-script/m-p/1820822#M67290</link>
      <description>&lt;P&gt;my if statement is failing, but I'm not sure why&lt;BR /&gt;&lt;BR /&gt;Here is my statement:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(Single_asset_only_assigned + Single_asset_only_derived = 1, 
    if(len(asset_class_assigned)&amp;gt;0, asset_class_assigned, asset_class_derived),
    if(Single_asset_only_assigned + Single_asset_only_derived = 2, 
        if(Single_asset_only_assigned = Single_asset_only_derived, asset_class_assigned,'')
    ,'')
) as "combo.Name of all asset classes"&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;the second "if" is highlighted&amp;nbsp;in red but I&amp;nbsp;cant seem to find anything wrong with the statement.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;getting the following message when script runs:&lt;BR /&gt;&lt;BR /&gt;The following error occurred:&lt;BR /&gt;Unexpected token: 'if', expected one of: ',', 'Inline', 'AutoGenerate', 'From', 'From_Field', 'Resident', 'Extension', ...&lt;BR /&gt;The error occurred here:&lt;BR /&gt;combo:&lt;BR /&gt;Load Distinct&lt;BR /&gt;*&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;if&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;(combo.Single_asset_only_assigned + combo.Single_asset_only_derived = 1, if(len(combo.asset_class_assigned)&amp;gt;0, combo.asset_class_assigned, combo.asset_class_derived),&lt;BR /&gt;if(combo.Single_asset_only_assigned + combo.Single_asset_only_derived = 2, if(combo.Single_asset_only_assigned = combo.Single_asset_only_derived, combo.asset_class_assigned,''),'')) as "combo.Name of all asset classes"&lt;BR /&gt;Resident combo_temp&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 20:25:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/if-statement-error-upon-loading-app-script/m-p/1820822#M67290</guid>
      <dc:creator>Panv</dc:creator>
      <dc:date>2021-07-08T20:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: if statement error upon loading app script</title>
      <link>https://community.qlik.com/t5/App-Development/if-statement-error-upon-loading-app-script/m-p/1820827#M67291</link>
      <description>&lt;P&gt;From the error message, it looks like you have an asterisk after the Load Distinct statement. If you remove it does that resolve the error?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 20:48:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/if-statement-error-upon-loading-app-script/m-p/1820827#M67291</guid>
      <dc:creator>Don_Stocks_</dc:creator>
      <dc:date>2021-07-08T20:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: if statement error upon loading app script</title>
      <link>https://community.qlik.com/t5/App-Development/if-statement-error-upon-loading-app-script/m-p/1820835#M67292</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/113023"&gt;@Panv&lt;/a&gt;&amp;nbsp; Put "," after "*"&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;combo:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Load Distinct&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;if&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 22:14:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/if-statement-error-upon-loading-app-script/m-p/1820835#M67292</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2021-07-08T22:14:20Z</dc:date>
    </item>
  </channel>
</rss>

