Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
i have a problem that i think you can help me
i have a list box in my QV document and i want if i select something in this list box the value or values store in variable
i want to use this variable in my query and it should separate with comma (,) for use it in my query
how should i resolve this solution
my query is something like blow :
SELECT FB.BUL_ID
FROM BI_USER.FACT_BILL fb
WHERE FB.F_CONSUME_TYPE IN ($(V$test))
Omid,
To create a variable with comma-separated values, you can define the variable in the "variables overview" using concat() function:
=concat(distinct YourField, ',')
But most likely you need to use also single quotes around the values. In this case, add chr(39) into separator, and also start and end:
=chr(39) & concat(distinct YourField, chr(39) & ',' & chr(39)) & chr(39)
Regards,
Michael
PS: I'm not sure it is a good idea to use $ inside the variable name V$test. Maybe it's OK, but I'd rather avoid it...