You can use the trim(x,y) function in Expression Builder.
The trim(x,y) function returns a string formed by removing all characters that appear in y from both sides of x. If there is no value for y, trim(x) removes spaces from both sides of x.
Go to Task Designer -> Task_Name -> Table Settings -> Transform -> click on the f(x) for column_name
For Build expression enter:
trim($first_name)
Save and then test the task to see if trailing spaces are removed.
The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.