Let ( String = //put your if functions here ;
Right ( String ; Length ( String ) - 4 )
) /* let */
I subtract 4 because I am counting 4 characters in that leading text, 2 spaces, a hyphen and a period, that you want omitted.
Brillant ! That exactly solves the issue.
Thanks a bunch !
Here is another approach which drops the nested If()s … so instead of solving only the removal of the beginning “. – “ by wrapping YOUR calculation with Phil's suggestion, maybe you can instead fix the overall calc:
List ( periodicite ; note_generale ; note_titre ; note_edition ; note_adresse ; note_collection ; note_reliure ; note_contenu )
; ¶ ; ". - " )
Nested If()s are very difficult to administer and understand and require several needless evaluations. This is just another approach. :^)
UPDATE: Just to explain a bit ... the List() function takes the values of a field and separates them with a carriage return (¶) but if the field is empty, it is skipped. So we use the List() function to grab all the fields you want. Then we take the list which ends up in a string down the page and replace the carriage return with your desired beginning text of ". - "
They're not really nested, they're in a chain linked by ampersands which makes it a little bit simpler to deal with, but LaRetta's solution is still an excellent way to simplify it.
You are right, Phil, they are not nested but I saw the extra unnecessary wrap of parentheses and didn't look any further and moved to rewriting the calc instead:
If ( (periodicite ≠ "") ; ". - " & periodicite ; "" ) &
For future considerions when using the If() function, it is suggested to use:
If ( IsEmpty ( periodicite ) ; ".-" & periodicite ) &
If no default result is specified, none is produced so you can drop the portion in blue above entirely.
I prefer to put it in as it makes it a touch easier (in my mind, but maybe I'm just being old fashioned as this wasn't an option in older versions of Filemaker as near as I can remember), and I think it can avoid confusion for new users who may not be as familiar with how If functions work as you and I are.
It's purely a preference on my part.