When using the 'or' evaluation, it is usually better to wrap the statement into its own brackets as the or evaluation will take place before the final evaluation eg:

Instead of:

If Contains('truck','t') Or Contains('truck',r) Then 1 Else 2 End

You would use:

If (Contains('truck','t') Or Contains('truck',r')) Then 1 Else 2 End

This simply allows for the underlying source to evaluate the value of the contains and then attribute the output.

Also, may I ask what your source is as this would probably be better for performance and for reducing impacts if this is done source-side simply as the Tableau interpreter will make a make quite a mess of this statement, injecting and using far more functions than you have initially written resulting in more reads and cycles than is necessary.