<?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 Calling A Source an an If Statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Calling-A-Source-an-an-If-Statement/m-p/2060554#M87018</link>
    <description>&lt;P&gt;Hi All.&amp;nbsp; I'm hoping someone can assist me.&amp;nbsp; At the top of my data load editor I have sources listed.&lt;/P&gt;
&lt;P&gt;SET Source_A = File1.txt&lt;/P&gt;
&lt;P&gt;SET Source_B = File2.xlsx&lt;/P&gt;
&lt;P&gt;SET Source_C = File3.xlsx&lt;/P&gt;
&lt;P&gt;I want to be able to create an IF statement that looks at the sources and then creates a value in a field.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;IF(Source_A, 'Lions',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;IF(Source_B, 'Tigers',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;IF(Source_C, 'Bears'))) AS Oh_My;&lt;/P&gt;
&lt;P&gt;Any help will be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Apr 2023 14:06:03 GMT</pubDate>
    <dc:creator>P_Saltzer</dc:creator>
    <dc:date>2023-04-14T14:06:03Z</dc:date>
    <item>
      <title>Calling A Source an an If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Calling-A-Source-an-an-If-Statement/m-p/2060554#M87018</link>
      <description>&lt;P&gt;Hi All.&amp;nbsp; I'm hoping someone can assist me.&amp;nbsp; At the top of my data load editor I have sources listed.&lt;/P&gt;
&lt;P&gt;SET Source_A = File1.txt&lt;/P&gt;
&lt;P&gt;SET Source_B = File2.xlsx&lt;/P&gt;
&lt;P&gt;SET Source_C = File3.xlsx&lt;/P&gt;
&lt;P&gt;I want to be able to create an IF statement that looks at the sources and then creates a value in a field.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;IF(Source_A, 'Lions',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;IF(Source_B, 'Tigers',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;IF(Source_C, 'Bears'))) AS Oh_My;&lt;/P&gt;
&lt;P&gt;Any help will be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 14:06:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calling-A-Source-an-an-If-Statement/m-p/2060554#M87018</guid>
      <dc:creator>P_Saltzer</dc:creator>
      <dc:date>2023-04-14T14:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calling A Source an an If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Calling-A-Source-an-an-If-Statement/m-p/2060599#M87022</link>
      <description>&lt;P&gt;Source_A etc are variables. You can reference them in a script expression using $() syntax.&amp;nbsp; So your if condition would be like:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;If('$(Source_A)' = 'something',&amp;nbsp; 'Lions',...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;I suspect what you are wanting to do is test the name of the file you are loading?&amp;nbsp; If so, your test would be:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if (FileName() ='$(Source_A)', 'Lions', ....&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;-Rob&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 16:15:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calling-A-Source-an-an-If-Statement/m-p/2060599#M87022</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2023-04-14T16:15:56Z</dc:date>
    </item>
  </channel>
</rss>

