Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ccifaldi
Contributor
Contributor

Remove leading / trailing commas

Hello! I have text data that is combined from multiple fields. The values need commas between them, which I have added. However, some of the fields are blank and the result yields multiple commas in a row. I am using Replace to remove multiple commas in a row. However, I need to remove any leading or trailing commas as well. First image below is script to combine the fields. Second image is the replace function. Third is the output before and after the replace function. 

ccifaldi_0-1654719122933.png

ccifaldi_1-1654719156741.png

ccifaldi_2-1654719204399.png

 

Labels (1)
  • SaaS

2 Replies
vinieme12
Champion III
Champion III

Try As below

 

=Mid(Replace(field,',,',''),2)

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ccifaldi
Contributor
Contributor
Author

Thanks! However, this does not work. It drops the leading comma and the first character of the next field because of the 2. It also leaves in tact all the multiple commas I want to remove. Here is the result when I try Mid(Replace....) ccifaldi_0-1654778619079.png