Multiple Choice

Community, hello. I'm new around here and do apologize if this is not the correct place to post my question.

When dealing with Multiple Choice parameter, how to handle when none is selected?
Example: consider a multiple-choice parameter named "mChoice" and the following SQL:
SELECT
*
FROM
[bla]
WHERE
[id] = {keyID}
AND [client] in ({mChoice})

when we have at least one item selected on that multiple choice parameter, it works out good;
But when there's none item selected, I'm unable of selecting every [client] possible.

Is there a way of doing it?

Hello Felippe and welcome to the Community!

You can have a calculated parameter as follows:

{Condition} = IF not isempty({mChoice}) THEN "[client] in (" & {mChoice} & ")" ELSE "1=1"

And then use it in the query as below:

SELECT
*
FROM
[bla]
WHERE
[id] = {keyID}
AND {Condition}

you angel! it worked <3
thank you very much @dgudkov

You're welcome :slight_smile: