Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Maintenance Revenue to exclude ......

From the code below my goal is to exclude "Grip" and "RH RECURE DATABASE SERVICE" from Maint_Revenue column
 
This is the slice of code that needs to be updated to  exclude Grip and RH RECURE DATABASE SERVICE
I have applied "||" as the logical operator to create an OR condition which may not be right.
What's would be the best way to write this code.
 
"Maint_Revenue", IF(NOT(LEFT(Contract_Items[QT Package],4)="Grip" || "RH RECURE DATABASE SERVICE"), Contract_Items[Price Monthly], 0),

 

 

  • Hi Anonymous -

     

    Try this

     

    Maint_Revenue =
    IF (
        NOT ( LEFT ( Contract_Items[QT Package], 4 ) = "Grip" ) &&
          NOT ( Contract_Items[QT Package] = "RH RECURE DATABASE SERVICE" ),
        Contract_Items[Price Monthly],
        0
    )
    

     

    Hope this helps

    David 

2 Replies

  • dedelman_clng's avatar
    dedelman_clng
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous -

     

    Try this

     

    Maint_Revenue =
    IF (
        NOT ( LEFT ( Contract_Items[QT Package], 4 ) = "Grip" ) &&
          NOT ( Contract_Items[QT Package] = "RH RECURE DATABASE SERVICE" ),
        Contract_Items[Price Monthly],
        0
    )
    

     

    Hope this helps

    David 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks David.  It was very helpful.