Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Remove duplicates and concatenate strings

(0) ShareShare
ReportReport
Posted on by 578

Hi Experts,

In my custom table I have some data as shown below, I need to remove the duplicates, concatenate the values having comma in between and display it in a report. Any help would be appreciated.

ItemId

Item1

Item1

Item1

Item2

Item2 

I need to display the result as  Item1,Item2.

Thanks in advance. 

  • MuthukumaranAX Profile Picture
    2,901 on at
    RE: Remove duplicates and concatenate strings

    you can follow MCallebert instruction to concatenate the string and you can do group by in the select statement to avoid duplicate values being selected

  • Suggested answer
    MCallebert Profile Picture
    45 on at
    RE: Remove duplicates and concatenate strings

    You can use something like that :

    str1260     yourItemids;
    yourtable   yourtable;
    
    while select itemid from yourtable
        group by yourtable.itemid
    {
        yourItemids  = strfmt(",%1", yourtable.itemid));
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,011 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans