this actually works when there is a space in single cell
but in the sql we have written query like if there are multiple values then it should come in new line but few values were null that is why it is coming blank space now we are trying to remove that blank space.
in sql it was difficult that is why we are trying to resolve this in reporting level.
Unfortunately, there is no reporting level there is no option remove space which are not in consistent in length.
This has to be resolved at SQL level or perform additional ETL to cleanup the spaces and ingest the data. Can you try excluding null values, before doing newline ?