Longview from insightsoftware

Developing Longview Models
Developing Longview Models This chapter contains information on these main topics: Creating Model documentsParts of a Model documentSample Model documentUsing Model functionsCreating Model documents A Model document in Longview Application Framework contains calculation rules for your Longview system to create or change data. It modifies the data by calculating the value of symbols according to...
Using Model functions
Using Model functionsThis section contains the Longview Application Framework functions you can use in a model. Click the links in the following table for detailed usage and syntax information.For information on using Longview Application Framework functions in a procedure, see “Using Procedure functions”.AbsIsLockedScheduleExistsAllocateIsMaintenanceOnSeriesAndIsMaintenanceUserSimultAttributeI...
Abs
AbsUse this function in an equation to evaluate an expression and to calculate its absolute value. Absolute value is the expression of a number as a positive value, regardless of whether it is actually positive or negative.You may find the Abs function useful for learning the deviation between planned and actual results.For information on using this function in a procedure, see Abs. Syntax Copy...
Allocate
Allocate Use this function in an equation to allocate a proportional set of values across another symbol. Note: Only those symbols to which the user has access will be included in the allocation.You can specify allocations in the dimension specified in a By statement (for example, By TIMEPER). CopySyntaxAllocate (IntersectSym, PatternSym[, PatternSourceSym][, Precision[, PlugSymName]])where:Int...
And
AndSee “Operators (arithmetic)”.
Attribute
AttributeUse this function to determine whether the specified attribute exists in the database. A return value of 1 means the attribute exists in the system; a value of 0 means that it does not.Note: If you create a variable to store the return value for this function, you must create the variable with the NUM type. CopySyntaxATTRIBUTEEXISTS ("AttrClass", "AttrName")        where:AttrClass is t...
AttributeFilter (CalculationBlock)
AttributeFilter (CalculationBlock)You can use an AttributeFilter to limit the effect of a calculation to symbols that meet the filter condition. Within a model, an AttributeFilter is embedded in a CalculationBlock, does not use the function keyword, and uses left braces as delimiters ( { ) containing the filter settings. Attribute filters can be used as AND or OR expressions. Attribute filters ...
Avg
Avg Use this function in an equation to calculate the average value of a set of numbers.CopySyntaxAVG (SymName[Structure], SymName[Structure])         where: Each SymName is a symbol, a series of symbols, or a range of symbols in the dimension specified in a CalculationBlock statement, whose total value you want to average. Structure is a range of symbols. Note: To specify a range of symbols, e...
BaseValue
BaseValue Use this function in an equation to find the first value for a symbol in a range, in the dimension specified in the By statement. For information on By, see “By”.You can use the BaseValue function by itself to copy the first value into all the corresponding cells of another symbol in the calculation dimension. You can also use the BaseValue function to produce a value for use by anoth...
By
By Use this function to specify the dimension through which calculations are performed.Normally, when doing a row calculation, your system calculates the values of the first row symbol in all columns and on all pages. Then it moves to the next row calculation, and proceeds in the same way; however, you may want to change the order of calculation so that your system does row calculations in a di...
CalculationBlock
CalculationBlock Use this function to define the DataArea to which subsequent calculations must be applied. A CalculationBlock statement stays in effect until you end the CalculationBlock. A CalculationBlock statement applies only while you run the document in which it appears. After creating the CalculationBlock statement, you can use range functions to further limit the calculation to the Dat...
Call
Call Use this function in Longview Application Framework to run a Subroutine Document from a Model Document.Use a Subroutine Document to avoid repeating common calculations in multiple Longview documents. You can also create a subroutine when you have to create a complex calculation.CopySyntaxCALL "Subroutine";ListPassedSyms;ListConstants;ListReturnSyms        where: "Subroutine" is a Subroutin...
Count
CountUse this Longview Application Framework command to return the number of items in a list. This command can be used with either a list variable or a symbol.Note: Only those symbols to which the user has access will be included in the return list.CopySyntaxCOUNT (Variable)COUNT ("DimName","SymName#")COUNT (Schedule,"DimName","SymName#")            where:Variable is the name of a variable."Dim...
Depr
Depr Use this function to calculate depreciation amounts. CopySyntaxDEPR ("DB", Source, Rate/Life, "Compute"[, OpeningBalance], [Salvage])        where: Source is a symbol or value representing the value of the asset being depreciated.Rate is either a number expressed as a percentage or number of periods. This must be a number between 0 and 1.Compute indicates whether the period (PD) or year-to...
Exp
Exp Use this function in an equation to raise a base value to an exponential power.CopySyntaxEXP (SymName|Structure[,SymName|Structure])            where: SymName is a symbol name containing numeric values, in the dimension specified in a CalculationBlock statement. Structure is a range of symbols. To specify a range of symbols, enter the first and last symbols in the range, separated by a colo...
FileExists
FileExistsUse this function to determine whether the specified file exists in the specified directory. A return value of 1 means the file exists in the specified directory; a value of 0 means it does not.Note: If you create a variable to store the return value for this function, you must create the variable with the NUM type. CopySyntaxFileExists("FileName")            where: FileName is the na...
Filter
FilterUse this function to filter the symbols affected by a calculation. A FILTER statement is similar to a WHEN statement, except that the filtering is not confined to the calculation block.Use this function to:specify a DataArea in which to check the filtering conditionidentify condition using operatorsstate an operation when the condition is evaluated to TRUEallow for filtering condition sym...
FValue
FValueUse this function in an equation to calculate the future value of a payment, or series of payments, at a given future date when compounded by a given interest rate. CopySyntax FVALUE OpeningSymName, AddSymName, Rate, IncreaseSymName, NumPeriods                    where: OpeningSymName is a symbol in the dimension specified in a CalculationBlock statement, representing the original value o...
GetDate
GetDate Use this function to store the current date, in calendar format, in a symbol. You can use Julian date functions to convert the date to a serial number that can be used in calculations. You may find this function useful for keeping track of System Events.CopySyntaxGETDATE(["Format"])                            where: Format is the formula for another method of returning a date, such as “...
GetLockComment
GetLockComment Use this function to retrieve the comment associated with a particular lock.A lock is a Longview database security feature preventing access to data currently used by another user. CopySyntaxGETLOCKCOMMENT("dataspec.lvdsp")                where:dataspec.lvdsp is the name of the DataSpec file.CopySyntax exampleCREATE VARIABLE TXT as stringSET VARIABLE TXT = GETLOCKCOMMENT("Tax_Dat...
GetLockUser
GetLockUser Use this function to retrieve the name of the user who created a particular lock.A lock is a Longview database security feature preventing access to data currently used by another user. CopySyntaxGETLOCKUSER("dataspec.lvdsp")        where:dataspec.lvdsp is the name of the DataSpec file.CopySyntax exampleCREATE VARIABLE TXT as stringSET VARIABLE TXT = GETLOCKUSER("Tax_Data.lvdsp")   ...
GetStatus
GetStatus You can use this function to obtain the status of various server features, such as eliminations, journal entries, schedules, and so on. These features are specified as either TRUE (activated) or FALSE (deactivated) in the Server configuration file (lvsrvr.cfg). When the server is started, it consults this file and turns these features on or off accordingly. This function is useful whe...
GetTime
GetTime Use this function to get the current time. You may find this function useful for keeping track of System Events. By default, the time appears in the format hh:mm:ss, if no other format is specified.CopySyntaxGETTIME (["Format"])            where: Format is the formula for another method of returning a timestamp, such as “mm:ss:hh”. If this parameter is not specified, time appears in the...
GroupExists
GroupExistsUse this function to determine whether the specified group exists in the database. A return value of 1 means the group exists; a value of 0 means it does not.Note: If you create a variable to store the return value for this function, you must create the variable with the NUM type. CopySyntaxGROUPEXISTS("Group")            where:Group is the name of the group to search for.CopySyntax ...
Grow
GrowUse this function to grow a series of values by a fixed amount. Each successive value is calculated as follows:Value1Value2Value3Value4OpenOpen _ additionopen + 2 * additionopen + 3 * additionThis function must be used with the BY function. The BY function determines the dimension in which the successive values are calculated. CopySyntaxGROW(OpenValue Addition [, Periods])        where: Ope...
Growth
GrowthUse this function to calculate the growth rate percentage of a series of values.For each symbol in the BY dimension, growth is calculated as:Copy[(symbolvalue1 - symbolvalue2) / symbolvalue1(-1)] "*" 100        Consider the following two examples of symbol values and the resulting calculated growth rate percentages:SymbolValue1SymbolValue2Growth Rate Percentage10095-59511217.8947This func...
If
If Use this function to carry out a set of instructions if a condition is TRUE. Do not confuse the If function with the When function:FunctionDescriptionIfTo carry out a set of instructions if any value of a symbol matches a condition.WhenTo carry out a set of instructions each time the contents of a cell match a condition.CopySyntaxIF ConditionInstructions [ELSEInstructions2]END IF            ...
IRR
IRRUse this function to calculate the internal rate of return (the rate that sets the NPV of cash flows to 0) or a series of cash flows. For each period, net inflow = inflow - outflow (outflow is expected to be a positive value). IRR must be used in conjunction with the BY function. The symbols in the BY dimension hold the series of values. The result of IRR is stored in the first symbol in the...
IsAreaBatchStatus
IsAreaBatchStatusUse this function to retrieve whether the specified status for batches that impact data in a specified data area is TRUE or FALSE. If the specified status for batches that impact data in a specified data area is TRUE, this function returns a value of 1. If the specified status for batches that impact data in a specified data area is FALSE, this function returns a value of 0. Sy...
IsAreaEventStatus
IsAreaEventStatusUse this function to retrieve whether the specified status for events that were triggered by data in a specified data area is TRUE or FALSE. If the specified status for events that were triggered by data in a specified data area is TRUE, this function returns a value of 1. If the specified status for events that were triggered by data in a specified data area is FALSE, this fun...
First Page
Back
For an optimal Community experience, Please view on Desktop