Skip to main content
Answer

IF AND OR function together

  • October 7, 2022
  • 2 replies
  • 243 views

Hi

I need to create a formula that as multiple conditions like in the screenshot.

My formule doesn’t work, can you help ?

Thanks,

Best answer by francois

Hi!

It’s difficult to say without looking at the exact data type of your expressions / metrics / properties, but from my understanding it seems that the problem lies with 'EC Extract'.Has_contract which could be text.

The error is indeed stating that the right operand is Text while it should be Boolean.

My steps to resolve this would be to simply type 'EC Extract'.Has_contract in a formula playground and look at what comes up - chances are the property is indeed text-type, so to turn it into a boolean you’d have to type something like 'EC Extract'.Has_contract = "YES" (or whatever expression is used there), or to create a boolean-type property in your dimension and refer to it, like 'EC Extract'.Has_contract_boolean instead.

Hope this helps!

2 replies

francois
Employee
Forum|alt.badge.img+13
  • Employee
  • Answer
  • October 7, 2022

Hi!

It’s difficult to say without looking at the exact data type of your expressions / metrics / properties, but from my understanding it seems that the problem lies with 'EC Extract'.Has_contract which could be text.

The error is indeed stating that the right operand is Text while it should be Boolean.

My steps to resolve this would be to simply type 'EC Extract'.Has_contract in a formula playground and look at what comes up - chances are the property is indeed text-type, so to turn it into a boolean you’d have to type something like 'EC Extract'.Has_contract = "YES" (or whatever expression is used there), or to create a boolean-type property in your dimension and refer to it, like 'EC Extract'.Has_contract_boolean instead.

Hope this helps!


  • Author
  • Wallflower
  • October 7, 2022

Thank you François !

Someone juste gave me an answer few minutes ago. The problem was the dimension!

I shouldn’t just type my text, but in what dimension it came from.

It works know, thanks a lot !