IN function

Hi,

Has anything changed with how the IN function operates? We have been using the IN function for months in a calculated field but as of recently we have been running into an error with visuals containing the field.

The calculated field is:

ifelse(
    in(NULL, ${Include}), value_x,
    in('Archived', ${Include}), value_y,
    value_z
    )

${Include} is a multiple value parameter with no default configured, and the two options are ‘Archived’ and another String

value_x, value_y and value_z are integer fields

The expected behaviour is that when all options are selected in the ${Include} parameter, then value_x should be displayed (as far as I am aware NULL is the same as select all)

When ‘Archived’ is selected in the ${Include} parameter, then value_y should be displayed

Otherwise display value_z

When all options are selected the visuals work as expected, but when ‘Archived’ or the other string are just selected, we run into this error:

IN function

Any help would be greatly appreciated, thanks!

Edit: I realise now writing this we could restructure the parameter and field to use a single value parameter, however originally the parameter had more options that just two and more fields being displayed, hence why it is a multi-value parameter

1 Like

Hello @Liam, I know exactly what you are talking about. I also experienced an issue in my calculated fields where the function to check for select all stopped working. Based on my testing, starting on Friday May 24th, there was a bug in Quick Sight that broke the ability to check for Select All on multi-value parameters using in(NULL, ${Parameter}). Then, last Thursday, May 30th, when I was working to try and find a work-around for the issue, the bug had been fixed.

All of my testing and development in the last week has been working as anticipated and the functionality is working as expected. If you wanted to switch back to multi-value parameters, it should be safe to do so.

1 Like