web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to concatenate values from multiple rows

(0) ShareShare
ReportReport
Posted on by 55

Hello Experts

I'm working with report. I have a situation similar to classic

ID - EXTID - VALUE

1 - 1 - Val1

2 - 1 - Val2

I need to concatenate values

( Final result : 1 - Val1, Val2 )

using SQL 2 CDS tool (then I will traslate it in FetchXML);

I tried WITH CTE, FOR XML PATH, with no luck

How can I complete this task?

Thanks

I have the same question (0)
  • Verified answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    Thank you for your query.

    In SQL Server you can use STRING_AGG() for this purpose.

    For example:

    SELECT [IDColumn], STRING_AGG([ValueColumn], ',') [ContactVal]
    
    FROM Table1
    
    GROUP BY [IDColumn]

    However, as far as I know, this will not work in SQL 4 CDS (it does not support STRING_AGG).

    Also, the fetch xml has limited aggregation options (Sum, Count, Avg etc.):

    Use FetchXML aggregation (Microsoft Dataverse) - Power Apps | Microsoft Docs

    I guess, your only option is to user grouping in SSRS report (not in the query) or use Join operation in SSRS expressions to concatenate values form rows:

    reporting services - How to convert multiple rows into one row in SSRS? - Stack Overflow

    SSRS concatenate field in one string delimited by comma - without SQL (microsoft.com)

  • Suggested answer
    Carlik Profile Picture
    55 on at

    Your last link was helpful!

    Thanks

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Tom_Gioielli 58 Super User 2026 Season 1

#2
Eugen Podkorytov Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Eugen Podkorytov 49

#3
Fiona_Tiernan Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Fiona_Tiernan 22 Moderator

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans