How do I make a cube gently bob up and down while also rotating?

And

Make sure that the timeline isolates the Z axis! Otherwise it will interfere with the rotation.