Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

cancel
Showing results for 
Search instead for 
Did you mean: 
emyemyemy
Contributor III
Contributor III

when i reload my code : My let List is being invisible in my sql query code when it has no value

I have a let list ( MyList) selected from an excel column table used in a where  sql query condition  :


SQL
set @MyValue= (select Mycolumn from (select column as MyColumn from `MydataBase`.`MyTable`
where column  in ($(MyList)) ORDER BY ID desc limit  1 )a);

This code is correct  only  when i have a not null list   but  when i have an empty list   the reloaded code showed a synthax  error near  from 'where column in () order  by ID desc limit 1 )a);'

it shows like i  wrote nothing between  ' () ' !!

How can  I  make Mylist  visible in my code  even when it  is null   ? how can i add this ondition ?

Thank you for any help or attention  !

 

0 Replies