Forum Discussion

ezequiel's avatar
ezequiel
Microsoft Employee
8 years ago
Solved

AND-OR on New Column

Hi

 

I'm trying to add a new column and using the following definition trying to combine OR/AND

 

= Table.AddColumn(#"Added Conditional Column1", "Compliance", each if (([Request Status] = "Pending" or [Request Status] = "Assigned to" or [Request Status] = "Processing" or [Request Status] = "Pending Approval" or [Request Status] = "On Hold" or [Request Status] = "Pending DocuSign" or [Request Status] = "Pending Recipient Information") and [Compliant Request]="NO") then "NO" else "YES")

 

but doesn't seems to work. I have on the column "Request Status" the value the value "Assigned to" and on the column "Compliant Requests" the value "NO" and I'm getting "YES" as result, when the expected result should be "NO".

 

Any clue on this?

 

thanks,

  • Hello ezequiel

     

    Not sure about the syntax of your AND / OR

     

    The correct syntax is : AND(X;Y) / OR (X;Y) 

     

    Maybe try to add a new column and then type in : 

     

    Column = IF(AND([Compliant Request]="NO";OR([Request Status] = "Pending";OR([Request Status] = "Assigned to";OR([Request Status] = "Processing";OR([Request Status] = "Pending Approval";OR([Request Status] = "On Hold";OR([Request Status] = "Pending DocuSign";[Request Status] = "Pending Recipient Information")))))));"NO";"YES")

    Not sure about the result matching what you are looking for (we need more details to help you)

    EDITED 16h24

3 Replies

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    Hi ezequiel ,

     

    Please check if there're some unprintable characters in your column. Use trim to remove those character and try again.

     

    Regards,

    Jimmy Tao

    • ezequiel's avatar
      ezequiel
      Microsoft Employee

      Hi Jimmy...I checked and there are not unprintable chars. Any other suggestion? Do you see any issue on the logic I built?

       

      Thanks,

      • quentin_vigne's avatar
        quentin_vigne
        Solution Sage

        Hello ezequiel

         

        Not sure about the syntax of your AND / OR

         

        The correct syntax is : AND(X;Y) / OR (X;Y) 

         

        Maybe try to add a new column and then type in : 

         

        Column = IF(AND([Compliant Request]="NO";OR([Request Status] = "Pending";OR([Request Status] = "Assigned to";OR([Request Status] = "Processing";OR([Request Status] = "Pending Approval";OR([Request Status] = "On Hold";OR([Request Status] = "Pending DocuSign";[Request Status] = "Pending Recipient Information")))))));"NO";"YES")

        Not sure about the result matching what you are looking for (we need more details to help you)

        EDITED 16h24