Notifications
Announcements
No record found.
Hi All,
I've a scenario where i've to concatenate two or more fields on computed column of view. How would it be possible. Any suggestion ?
Hi,
Look at MS Docs, the example given is of concatenation:
docs.microsoft.com/.../walkthrough-add-a-computed-column-to-a-view
Hi Zohan 93,
You can use SysComputedColumn::add. Please check the sample code below -
public static server str stingConcatenate() { return SysComputedColumn::add(SysComputedColumn::returnField(tableStr(View1), identifierStr(table_1), fieldStr(table1, Field1)), SysComputedColumn::returnField(tableStr(View1), identifierStr(table_1), fieldStr(table1, Field2)) ); }
Hi Zohan,
Here is a share:community.dynamics.com/.../how-to-concatenate-two-fields-get-from-view-with-hyphen
More about SysComputedColumn: docs.microsoft.com/.../gg945162(v=ax.60)
Hi Gunjan, I need to concatenate two string fields. not adding them
What's the difference?
Adding string fields is equivalent to concatenating them. Did try writing a method for the computed field this way?
Yes I've tried it but when ever i tried to use the keyword hyphen "|", it throws an error on build.
Anyhow i've tried Concat keyword but this shows me in this format, need to add hyphen after dimension change
below is my result i'm getting using Concat:
Branch20Department65MainAccount511301Segment54BusinessUnit02
You can try using SysComputedColumn::returnLiteral -
SysComputedColumn::returnLiteral("-"),
Do you have any particular reason to implement your own solution for dimensions instead of using the standard one? You can check LedgerJournalLineEntity, for example.
Anyway, the result seems to be what you asked for. If you want to add a delimiter, you could utilize CONCAT_WS() instead of CONCAT(). But you shouldn't - you should use the standard solution, which also respect the standard separator defined in parameters.
the add functionality accepts only two arguments. i've to write my own custom method for this ? i guess
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 559 Most Valuable Professional
André Arnaud de Cal... 464 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader