Thursday, 1 March 2018

Merge two column values using calculated column in SharePoint

Scenario:

I continuously work in SharePoint and get some experience. Today I got a task to get value of two columns and concatenate it and store it in third column. So I know I can do that using calculated column. I have heard about it. Didn't you? but how exactly it works?

Solution:

So I have google on calculated column and what I found was a hidden treasure. You can get it too by clicking reference link. Microsoft has documented each type of scenario on there. But as my part was only for concatenation of two string, I have used "&" operator in between two columns and it worked great. I have put option related my scenario below:

Column1 Column2 Formula Description (possible result)
Love Thakker =[Column1]&[Column2] Combines the two strings (LoveThakker)
Love Thakker =[Column1]&" "&[Column2] Combines the two strings, separated by a space (Love Thakker)
Love Thakker =[Column2]&", "&[Column1] Combines the two strings, separated by a comma and a space (Love, Thakker)
Love Thakker =CONCATENATE([Column2], ",", [Column1]) Combines the two strings, separated by a comma (Love,Thakker)


Reference:

As I mentioned earlier, you can go on below link and check other scenarios as well:

No comments:

Post a comment