Calculation or logic based on conditions

Hello Leaders

I hope you’re doing well.

What’s wrong with this calculation: " if((${tofmodules_PRM}=‘1’ and ${tofmodules_PRM}=‘2’ and ${tofmodules_PRM}=‘3’ and ${tofmodules_PRM}=‘4’ and ${tofmodules_PRM}=‘5’ and ${tofmodules_PRM}=‘6’ and ${tofmodules_PRM}=‘7’),1,0) "

How can you support, it’s dont match.

Thanks

As written, this expression with always be false; tofmodules_PRM cannot ever equal multiple different values at the same time…

Without knowing more about what tofmodules_PRM is or what you are trying to check, its not really possible to recommend how to fix it. However, if you want to check whether tofmodules_PRM is one of several permitted values, use an or instead of an and.

Alternatively, if tofmodules_PRM is, say, a select multiple response, and you want to see if all the above options have been selected, then you will need to use the selected() function; eg

if(selected(${tofmodules_PRM},‘1’) and selected(${tofmodules_PRM},‘2’) ... ,1,0)

2 Likes

Thanks

I really appreciat yàour support.

The last paragraph " Alternatively, if ... ,1,0)" was the solution, is the sollution, it matches when I apply it.

Thanks again.

Best regards !

1 Like