<?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: when i reload my code : My let List is being invisible in my sql query code when it has no value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/when-i-reload-my-code-My-let-List-is-being-invisible-in-my-sql/m-p/1696924#M450991</link>
    <description>&lt;P&gt;There was a bracket too much and the variable needs here to be set in quotes because the content is a string, therefore try it in this way:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if len(trim('$(MyList)')) &amp;gt;= 1 then&lt;BR /&gt;...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Mon, 27 Apr 2020 06:42:24 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2020-04-27T06:42:24Z</dc:date>
    <item>
      <title>when i reload my code : My let List is being invisible in my sql query code when it has no value</title>
      <link>https://community.qlik.com/t5/QlikView/when-i-reload-my-code-My-let-List-is-being-invisible-in-my-sql/m-p/1696268#M450955</link>
      <description>&lt;P&gt;&lt;FONT size="1" color="#000000"&gt;&lt;STRONG&gt;I have a let list&amp;nbsp; selected from an excel file&amp;nbsp; used in a where sql query&amp;nbsp; :&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;FONT color="#0000ff"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;set&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;@MyValue=&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;(select&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;Mycolumn &lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;from&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;(select&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;column &lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;as&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;MyColumn &lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;from&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;`MydataBase`.`MyTable`&lt;/FONT&gt;&lt;FONT size="1"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;where&lt;/FONT&gt;&amp;nbsp;&lt;FONT size="1" color="#ff0000"&gt;column &lt;/FONT&gt;&amp;nbsp;&lt;FONT size="1" color="#ff0000"&gt;in&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT size="1" color="#808080"&gt;$(MyList)&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;FONT size="1" color="#ff0000"&gt;)&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;ORDER&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;BY&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;ID &lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;desc&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;limit&lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;&amp;nbsp; 1 &lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;)a)&lt;/FONT&gt;&lt;FONT size="1"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;This code is correct&amp;nbsp; only&amp;nbsp; when i have a not null list&amp;nbsp;&amp;nbsp; but&amp;nbsp; when i have an empty list&amp;nbsp;&amp;nbsp; the reloaded code showed a synthax&amp;nbsp; error near&amp;nbsp; from 'where column in () order&amp;nbsp; by ID desc limit 1 )a);' &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;it shows like i&amp;nbsp; wrote nothing between&amp;nbsp; ' () ' !!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;How can&amp;nbsp; I &amp;nbsp;make Mylist&amp;nbsp; visible in my code&amp;nbsp; even when it&amp;nbsp; is null&amp;nbsp;&amp;nbsp; ? how can i add this ondition ? &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;Thank you for any help or attention&amp;nbsp; ! &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 21:01:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/when-i-reload-my-code-My-let-List-is-being-invisible-in-my-sql/m-p/1696268#M450955</guid>
      <dc:creator>emyemyemy</dc:creator>
      <dc:date>2020-04-23T21:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: when i reload my code : My let List is being invisible in my sql query code when it has no value</title>
      <link>https://community.qlik.com/t5/QlikView/when-i-reload-my-code-My-let-List-is-being-invisible-in-my-sql/m-p/1696322#M450959</link>
      <description>&lt;P&gt;I think you will need something like this:&lt;/P&gt;&lt;P&gt;if (len(trim($(MyList))) &amp;gt;= 1 then&lt;BR /&gt;&amp;nbsp;&amp;nbsp; let vWhere = 'where column in ($(MyList))';&lt;BR /&gt;else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; let vWhere = '';&lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;FONT color="#0000ff"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;set&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;@MyValue=&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;(select&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;Mycolumn &lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;from&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;(select&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;column &lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;as&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;MyColumn &lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;from&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;`MydataBase`.`MyTable`&lt;/FONT&gt;&lt;FONT size="1"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="6" color="#000000"&gt;&lt;STRONG&gt;&lt;FONT&gt;$(vWhere)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;ORDER&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;BY&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;ID &lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;desc&lt;/FONT&gt; &lt;FONT size="1" color="#ff0000"&gt;limit&lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;&amp;nbsp; 1 &lt;/FONT&gt;&lt;FONT size="1" color="#ff0000"&gt;)a)&lt;/FONT&gt;&lt;FONT size="1"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 04:47:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/when-i-reload-my-code-My-let-List-is-being-invisible-in-my-sql/m-p/1696322#M450959</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-04-24T04:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: when i reload my code : My let List is being invisible in my sql query code when it has no value</title>
      <link>https://community.qlik.com/t5/QlikView/when-i-reload-my-code-My-let-List-is-being-invisible-in-my-sql/m-p/1696854#M450988</link>
      <description>&lt;P&gt;Hello Marcus !&lt;/P&gt;&lt;P&gt;Thank you for your answer , I did try your suggestion i think its&amp;nbsp; a great idea using the $(vWhere) either i got an error script at&amp;nbsp; 'len(trim($(MyList))) '&lt;/P&gt;&lt;P&gt;I Think&amp;nbsp; this expression is incorrect counting&amp;nbsp; List items !&lt;/P&gt;&lt;P&gt;I am trying to figure out the problem , and grateful for any help&amp;nbsp;or suggestion !&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 22:28:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/when-i-reload-my-code-My-let-List-is-being-invisible-in-my-sql/m-p/1696854#M450988</guid>
      <dc:creator>emyemyemy</dc:creator>
      <dc:date>2020-04-26T22:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: when i reload my code : My let List is being invisible in my sql query code when it has no value</title>
      <link>https://community.qlik.com/t5/QlikView/when-i-reload-my-code-My-let-List-is-being-invisible-in-my-sql/m-p/1696924#M450991</link>
      <description>&lt;P&gt;There was a bracket too much and the variable needs here to be set in quotes because the content is a string, therefore try it in this way:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if len(trim('$(MyList)')) &amp;gt;= 1 then&lt;BR /&gt;...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 06:42:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/when-i-reload-my-code-My-let-List-is-being-invisible-in-my-sql/m-p/1696924#M450991</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-04-27T06:42:24Z</dc:date>
    </item>
  </channel>
</rss>

