Runing enemys

Anyone know how to make an enemy/item run away from the player

Extract the enemy X and the player X and subtract them.
If the number is > 0 run right and if its < 0 to run left.

This x - player x = Filter <0>