
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If you do it in a mapbasic, updating a table is much quicker if you use a function something like:
Sub Main
set table Tablename fastedit on
Update Table Tablename Set resultfieldMaxValue = fGetMaximumValue(RSRP01, RSRP02, RSRP03)
Update Table Tablename Set resultfieldMaxField= fGetMaximumField (“RSRP01”, RSRP01, “RSRP02”, RSRP02, “RSRP03”, RSRP03)
End Sub
Function fGetMaximumValue(ByVal Field1 As Float, ByVal Field2 As Float, ByVal Field2 As Float) As Float
fGetMaximumValue = Maximum(Field1,Maximum(Field2,Field3))
End Function
Function fGetMaximumField(ByVal sField1Name As String, ByVal Field1 As Float, ByVal sField2Name As String, ByVal Field2 As Float, ByVal sField3Name As String, ByVal Field2 As Float) As String
If Field1 >= Field2 And Field1 >= Field3 Then
fGetMaximumField = sField1Name
ElseIf Field2 >= Field1 And Field2>= Field3 Then
fGetMaximumField = sField1Name
ElseIf Field3 >= Field1 And Field3>= Field2 Then
fGetMaximumField = sField3Name
End If
End Function
this look like an LTE log file. let me save you lots of time DON"T use mapinfo use VB.net and ONLY create maps with mapinfo
--
Did you try creating a custom function and using this to update your column?
Function GetColumnWithMaximumValue( ByVal sColName1 As String
, ByVal sColName2 As String
, ByVal sColName3 As String
, ByVal fColValue1 As Float
, ByVal fColValue2 As Float
, ByVal fColValue3 As Float
) As String
If fColValue1 > fColValue2 Then
If fColValue1 > fColValue3 Then
GetColumnWithMaximumValue = sColName1
ElseIf fColValue1 < fColValue3 Then
GetColumnWithMaximumValue = sColName3
End If
ElseIf fColValue1 < fColValue2 Then
If fColValue2 > fColValue3 Then
GetColumnWithMaximumValue = sColName2
ElseIf fColValue2 < fColValue3 Then
GetColumnWithMaximumValue = sColName3
End If
End If
End Function
And the update statement would look like this:
Set Table MYTABLE FastEdit On Undo Off
Update MYTABLE
Set MAXCOLUMNNAME = GetColumnWithMaximumValue(“RSRP01”, “RSRP02”, “RSRP03”, RSRP01, RSRP02, RSRP03)
, MACVALUE = Maximum(RSRP01,Maximum(RSRP02,RSRP03))
Commit Table MYTABLE
Please note that I don’t really deal with the situation where values are alike.
It will also speed up things if you remove any index on the columns you are updating
I hope this helps
Peter Horsbøll Møller
Pitney Bowes
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com]
On Behalf Of MEHMET HINC
Sent: 13. oktober 2015 11:57
To: mapi...@googlegroups.com
Subject: Re: [MI-L] Maximum Function
Hi Uffe, All