AnsweredAssumed Answered

Let and Case Function - Calculation Question

Question asked by lindseym on Dec 23, 2016
Latest reply on Dec 27, 2016 by lindseym

Hello and Happy Holidays

 

I am trying to combine the contents of two columns into one.

 

 

Column 1 Title: Location Calculation

Column 1 Contents: 201

 

Column 2 Title: Building From Spaces

Column 2 Contents: A

 

 

I have this calculation, and it is working for what I typically do - which is usually get the location calculation only.

 

Let ( [

  text =  LeftWords ( Location Calculation ; 1 ) ;

  n = text + 0 ;

  text = Case ( n = 0 ; text ; n )

] ;

Case (

  ${Copy (Side A)} = "BLDGLOC #" ;

  Substitute ( text ;

    "TBD" ; TextStyleAdd ( "TBD" ; HighlightYellow ) );

 

  Substitute (

  ${Copy (Side A)} ;

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

  ["LOC #" ; text ]

  )

)

)

 

It properly returns the left words of the column titled: Location Calculation

 

Now I want to modify the above to return the contents from a column called "Building From Spaces"

 

 

I tried this:

Let ( [

  text =  GetField ( Building from Space ) & LeftWords ( Location Calculation ; 1 ) ;

  n = text + 0 ;

  text = Case ( n = 0 ; text ; n )

] ;

Case (

  ${Copy (Side A)} = "LOC #" ;

  Substitute ( text ;

    "TBD" ; TextStyleAdd ( "TBD" ; HighlightYellow ) );

 

  Substitute (

  ${Copy (Side A)} ;

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

  ["LOC #" ; text ]

  )

)

)

 

and it returns: BLDG201 When the location calculation is 201 and the building is A

 

What I want is A201

 

(also, im still working on the n = text + 0 part of the function --- just know right now it does what I need it to do

 

 

Thanks!

-L

Attachments

Outcomes