LookUp (Total)
This function is similar to average except it returns the total value of all the ReturnValues of the lines where the LookUpValue is equal to the SourceSymbol value.
Syntax:
LOOKUP ("Total","Table",SourceSymName)
where:
- Total is the name of the lookup method.
- Table is the name of an ASCII file containing the table of values to be referenced by the LookUp function.
- SourceSymName is a symbol in the dimension specifying the criteria for selection.
If the criteria is not found, the cell is not changed. To avoid any confusion, specify the values in the target symbol as zero before running a Model Document.
Table format
LookUpValue @ ReturnValue
All LookUp values must be numeric.
Example table
10 @ 110
11 @ 200.50
12 @ 130
13 @ 140
11 @ 333.01
15 @ 150
16 @ 50.25
11 @ 100.25
Syntax example:
SALES3=LOOKUP("Total",LookupTable.txt,CASH1)
If the LookupTable file contains the entries shown above and CASH1 contains 11, the value returned is sum of 200.50, 333.01 and 100.25 and this is assigned to SALES3.
(If the ReturnValue for a line that matches is a string, it is treated as numeric 0).