July 1, 201411 yr Hi All, I have this fairly simple field, it's a calculation that returns a list, and it works well: If ( IsEmpty ( IP Addresses::IPv4 Address ); "No Static IP"; List ( IP Addresses::IPv4 Address ) ) However, in the resulting list that displays, I'd like to substitute the carriage returns with commas, and I've come up with this bit of code to make the substitution: Substitute ( IP Address Display; "¶" ; ", " ) Is this correct? If so, where do I place the substitute statement? Will it go into the same calculation I use to define the field, or do I have to put this into a brand new field of its own? Thanks in advance, C
July 1, 201411 yr Nice job of breaking out the calculation need. :-) Wrap the Substitute() around the List() function to turn its pilcrow into comma-space. If ( IsEmpty ( IP Addresses::IPv4 Address ) ; "No Static IP"; Substitute ( List ( IP Addresses::IPv4 Address ) ; ¶ ; ", " ) ) As for where/how to use it, it sounds like simply for display. Is it display on a report, portal, or how is it used? Normally you do not want to create any calculation unless you absolutely have to. Edited: corrected calculation Edited July 1, 201411 yr by LaRetta
July 1, 201411 yr You have a typo: the pilcrow character can be either quoted or (if on its own) not quoted - but not half-quoted.
July 1, 201411 yr I am such a fuss bucket. I had to correct it. But I'm not nearly so much a fuss bucket as you, Michael ... you never make the mistakes to begin with. ;-)
July 1, 201411 yr Author Ah, beautiful! I didn't realize you could embed a function into another function where it asks for a field. Coolbeans Thanks for the help.
July 1, 201411 yr I remember when lightbulbs began to fire on this myself! And you'll question ... which function should go on the outside and which on the inside. Sometimes it doesn't matter but most times it does. Just keep in mind that FM evaluates the innermost function first so in this case, the List() and then the Substitute() is applied against that. Calculations rock.
Create an account or sign in to comment