This field is required.
Only these extensions are allowed(.jpg, .JPG, .jpeg, .JPEG, .gif, .GIF, .png, .PNG)
Tags cannot contain the characters ' /, \\, #, ?, or ; >,< '
Only these extensions are allowed(.zip,.ZIP,.pdf,.PDF,.qvf,.QVF,.qvw,.QVW)
Discussion Board for collaboration related to QlikView App Development.
I have a let list selected from an excel file used in a where sql query :
SQLset @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 !
I think you will need something like this:
if (len(trim($(MyList))) >= 1 then let vWhere = 'where column in ($(MyList))';else let vWhere = '';end if
SQLset @MyValue= (select Mycolumn from (select column as MyColumn from `MydataBase`.`MyTable`$(vWhere) ORDER BY ID desc limit 1 )a);
View solution in original post
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:
if len(trim('$(MyList)')) >= 1 then...
Hello Marcus !
Thank you for your answer , I did try your suggestion i think its a great idea using the $(vWhere) either i got an error script at 'len(trim($(MyList))) '
I Think this expression is incorrect counting List items !
I am trying to figure out the problem , and grateful for any help or suggestion !