Writing MapInfo Label Expression to label lots in format Map-Lot (017-001) with just Lot

by Zack   Last Updated October 20, 2019 05:22 AM - source

I am trying to label map lots in this format Map-Lot (017-001) and I was wondering if there was a label expression that would allow me to only show the lot number and not the map number.

Tags : mapinfo labeling


Answers 2


If I understand your question correctly, you might have values in the Map-Lot field that look like the following:

017-001
017-002
018-121

And you only want to show the portion after the "-". So, the above would be displayed like this:

001
002
121

If your Lot number is always going to be three characters long, then you can use the following label expression:

Right$(Map-Lot,3)

However, if your field values are like this:

017-001
018-1234
017-184855

Then you can use something like the following:

Mid$(Map-Lot, InStr(1, Map-Lot, "-")+1, Len(Map-Lot))

Your resulting labels will look like the following:

001
1234
184855

You can have a look in the MapInfo documentation on string functions for more explanation of the Mid$, Right$, and InStr functions.

Fezter
Fezter
March 25, 2014 23:05 PM

Try Mid$(Map-Lot, 5, 3) if all of the Map-Lot are the same number of digits.

Damien
Damien
March 26, 2014 06:03 AM

Related Questions


Adding Label Classes to Polyline in MapInfo Pro

Updated February 28, 2019 17:22 PM

Mapinfo: Color label by attribute-expression

Updated January 12, 2017 09:09 AM


How to make a column as a layer of label?

Updated July 01, 2017 22:22 PM

Clustered labeling in Mapinfo

Updated February 25, 2016 01:09 AM