1
votes

I started with a text prompt where a user can enter a string representing days in a single week. For example, M = Monday, and MWF can be typed in to choose Monday, Wednesday, and Friday.

I've just changed the prompt to a multi-select value prompt, and modified my filters to work correctly. Now my prompt looks like this:

enter image description here

When the user selects the items Monday, Wednesday, Friday, the ParamValue list is M,W,F.

How can I display MWF as a data item?

Specifically, I want to combine the new day(s) with a time selected so I can get an output result of MWF 0800 - 1100 but the time values are already taken care of.

Can I somehow index the values inside the multi-select value?

Edit: I should also mention that variations on

?p_NewDays? ||  ' ' || ?p_NewStartTime? || '-' || ?p_NewEndTime? 

don't seem to work, it will only list the first item in the selection. And TO_CHAR only works for dates.

1

1 Answers

1
votes

You can accomplish this with a vendor provided replace() function replacing each comma with an empty string. However, the implementation of such function varies from vendor to vendor. For a vendor-neutral solution you can use this expression to do the same thing:

CASE 
WHEN 'M' in ?param? THEN 'M' 
ELSE ''  
END 
||
CASE 
WHEN 'T' in ?param? THEN 'T' 
ELSE ''  
END 
|| 
CASE 
WHEN 'W' in ?param? THEN 'W' 
ELSE ''  
END 
|| 
CASE 
WHEN 'Th' in ?param? THEN 'Th' 
ELSE ''  
END 
|| 
CASE 
WHEN 'F' in ?param? THEN 'F' 
ELSE '' 
END 
|| 
CASE 
WHEN 'S' in ?param? THEN 'S' 
ELSE '' 
END 
|| 
CASE 
WHEN 'Su' in ?param? THEN 'Su' 
ELSE '' 
END 

I used the generic ?param? for the parameter name. You would have to change it to match your specific parameter.

You didn't indicate how you differentiate between Tuesday and Thursday as well as Saturday and Sunday. I simply used the first initial for the first day of the week to start with that letter and used a common two-letter abbreviation for the second instance.