- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello helpers:)
I am trying to concatenate client's contact into one column and do not want it appears multiple times if the same number registered under home/work/mobile.
Client_Contact=catx(',',Home_Phone,Work_Phone,Mobile_Phone);
I googled and only found below solution. Just wondered if there is any other better way to achieve it?
Thanks in advance 🙂
https://stackoverflow.com/questions/42616892/sas-remove-duplicated-words-in-a-string
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You could reset the values before concatenating?
H=ifc( Home_Phone = Work_Phone , ' ', Home_Phone );
M=ifc( Home_Phone = Mobile_Phone , ' ', Mobile_Phone);
W=ifc( Work_Phone = Mobile_Phone , ' ', Work_Phone );
Client_Contact=catx(',', H, M, W);
Otherwise, if you had many values in the list, using call sortx allows you to only compare to the next value in the list rather than compare to the rest of the whole list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You could reset the values before concatenating?
H=ifc( Home_Phone = Work_Phone , ' ', Home_Phone );
M=ifc( Home_Phone = Mobile_Phone , ' ', Mobile_Phone);
W=ifc( Work_Phone = Mobile_Phone , ' ', Work_Phone );
Client_Contact=catx(',', H, M, W);
Otherwise, if you had many values in the list, using call sortx allows you to only compare to the next value in the list rather than compare to the rest of the whole list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content