AnsweredAssumed Answered

Combining or nest calculations

Question asked by lindseym on Dec 30, 2016
Latest reply on Dec 30, 2016 by erolst

Hello,

 

I have two calculations that I want to combine and I am having trouble doing so. Both work individually. When I try to combine them, FMP throws and error:

 

Screen Shot 2016-12-30 at 11.00.10 AM.png

 

and then highlights this:

 

Screen Shot 2016-12-30 at 11.00.17 AM.png

 

 

 

The first: (removes leading zeros from field-- I took this off the forum, so please don't think I know what I am doing! )

 

https://community.filemaker.com/thread/120925?q=removing%20leading%20zeros curtesy of LaRetta_1

 

Let ( [

t = LeftWords ( Location Calculation ; 1 ) ;

x = Filter ( LeftWords ( t ; 1 ) ; "0123456789" )  = LeftWords ( t ; 1 ) ;

l = Length ( LeftWords ( t ; 1 ) ) ;

n = GetAsNumber ( LeftWords ( t ; 1 ) )

] ;

Case (

x ; n & Right ( t ; Length ( t ) - l )  ; t

) // end case

) // end let

 

 

And the second: (substitutes)

 

Substitute (

${Copy)} ;

["XLEVEL#" ; "*" & Level from Space] ;

["LEVEL#" ; Level from Space] ;

["STAIR#" ; Stair from Space] ;

["BLDG#" ; Building from Space] ;

["LOC#" ; LeftWords ( Location Calculation ; 1 )] ;       This is the substitution that would need the leading zeros removed

["TBD" ; TextStyleAdd ( "TBD" ; HighlightYellow )]

 

 

)

 

 

Any guidance is appreciated!

 

 

Happy New Year!

 

 

-L

Outcomes