I have been struggling with this issue for a while and thought I'd ask somewhere. My end goal is an empty text box parameter that allows multiple values... But is completely optional.
I cannot use a drop-down multi-select because I have ~100k possible values.
I have successfully set up a report where users can enter multiple comma-separated values, and it will return results... But they HAVE to enter at least one value.
I have also set up a different report where users can enter just ONE value, or select "Null" and make that parameter completely optional.
I need both at once...
Any tips?
Answered, thanks to Matt!
Query Used (Oracle DB without write permissions):
with temptable1 as
(select :variablename variablename
from random_arbitrary_table
),
temptable2 as
(select distinct trim(regexp_substr(variablename, '[^,]+', 1, level)) as field_name
from temptable1
connect by level <= regexp_count(variablename, '[^,]+')
and prior dbms_random.value is not null
)
select *
from main_query_table mqt
left join temptable2 tt2
on mqt.field_name = tt2.field_name
where ((:variablename is not null and mqt.field_name = tt2.field_name)
or :variablename is null)
-- Set @variablename parameter to 'Allow Null' and default (NULL).