none
How to concatenate two strings in custom field formula RRS feed

  • Question

  • Hello,

    is it possible to concatenate two strings in a formula of a custom field? The strings come from other custom fields.

    I've tried different approaches like

    [Field 1] & ' ' & [Field 2]

    but the resulting field is always empty. I've tried + as concatenate operator, too.

    Regards,

    Ronny

     

    Tuesday, January 31, 2012 12:59 PM

Answers

  • Hi,

    You just need to use plus sign + operator to concatenate like

    [Field 1] + [Field 2]

    and for space use like this

    [Field 1]+'  '+[Field 2]

    You'll get the value in the assigned CF when you save some values for F1 and F2

     


    Thanks, Kashif
    • Edited by Kashif Nizam Tuesday, January 31, 2012 3:32 PM
    • Proposed as answer by Jan R. Cirpka Thursday, February 2, 2012 2:02 PM
    • Marked as answer by ronny_kl Friday, February 3, 2012 7:38 AM
    Tuesday, January 31, 2012 3:23 PM

All replies

  • Hi,

    You just need to use plus sign + operator to concatenate like

    [Field 1] + [Field 2]

    and for space use like this

    [Field 1]+'  '+[Field 2]

    You'll get the value in the assigned CF when you save some values for F1 and F2

     


    Thanks, Kashif
    • Edited by Kashif Nizam Tuesday, January 31, 2012 3:32 PM
    • Proposed as answer by Jan R. Cirpka Thursday, February 2, 2012 2:02 PM
    • Marked as answer by ronny_kl Friday, February 3, 2012 7:38 AM
    Tuesday, January 31, 2012 3:23 PM
  • Hi,

    I only made this to work when using double quotes " "

    greetings,

    Wednesday, February 1, 2012 1:44 PM
    Moderator
  • Thanks Kashif, thanks Jan,

    It works for me with single quotes, BUT: after adding the calculated field, each project must be opened and saved at least once, so that the formula of the new field is calculated. Just adding the calculated field isn't enough.

    That doesn't really make sense. Imagine, there are already 500+ projects in Project Server and you want to add a new calculated column that displays data from two already existing columns... "So, where is our trainee? Over there? ... Cooking coffee? ... Come along guy, sit here, click 'Edit', click 'Save', do this 500 times!" (c; Just kidding...

    @Microsoft: please fix it!

    Regards,

    Ronny

     

    Thursday, February 2, 2012 6:37 AM
  • Ronny, you can write a small routine (console app) and and iterate over your server's project, checkout, checking and publish. Doing this process manually is tedious!

     


    Thanks, Kashif
    Thursday, February 2, 2012 7:18 AM
  • Yes, of course. I was just kidding in my previous post.

    Regards,

    Ronny

    Thursday, February 2, 2012 10:01 AM