Guys, first I would like to apologize if the text is strange, I’m using Translate. If something is confusing, please tell me and I will rewrite it.
I’m using this function to make the sum according to the parameter chosen in the control:
sum(
ifelse(
(isNull(${MyParameter}) OR contains({MyColumn}, ${MyParameter})),
{value},
0
)
)
Currently, it is working because control is the only choice. However, if I try to use a multiple choice control, this function does not work. Is there any way I can adapt this function to a multiple choice control?
Hi @martinsfgr,
I think the way to achieve this is to create a calculated column that will return a True/False value (1,0) based on the selections on your control. This calculated field is just so you can perform the filter. In the visual you can use the value column and the filter will be the Calculated field.
Filter Calc Field = ifelse(in({MyColumn},${MyParameter}), 1, 0)
Use the reference for in function below.
Regards,
Giri
1 Like
@Giridhar.Prabhu
Thank you very much! It worked perfectly. I created a calculated field with a conditional to perform a sum when the return of this function you gave me was 1 or when the parameter was null (when the “All” option was selected). This way the parameter with multiple selection perfectly.
= ifelse(ifelse(in({MyColumn}, ${MyParameter}) OR in(NULL, ${MyParameter}), 1, 0) = 1, {MyColumn}, 0)
1 Like