Examples of Expressions
See also: Expressions, Understanding Expression Inheritance, Expression Elaboration, The Expression Builder
|
Type |
Description |
Example Syntax and Graph |
|
Simple Number |
Calculates a constant value in all scenario years |
3.1415 |
|
Simple Formula |
Calculates a constant value in all scenario years |
0.1 * 5970 |
|
Growth |
|
Growth(3.2%) |
|
Interp |
|
Interp(2000, 40, 2010, 65, 2020, 80)
|
| Interp from Excel Data | As Interp, but instead of the user specifying the data explicitly in the formula, this approach gets data from a range (myrange) in a separate Excel spreadsheet (mysheet.xlsx). The range should be a 2*X or X*2-sized range containing years and values arranged in ascending chronological order (where X is the number of years/values). Your LEAP model will automatically be updated if the data in the spreadsheet changes. |
Interp(mysheet.xlsx, myrange) |
| Interp from the LEAP Cloud Data Server (LCDS) | As Interp, but in this case data is retrieved from a data set stored online in the LEAP Cloud Data Server. The second parameter defines the data set being accessed. In this example, medium variant population projections from the UN Population Prospects data set for Argentina are retrieved. The LCDS contains the data from many different open source databases. The last parameter "ARG" denotes a country. This parameter can be omitted if the country is already set in the Settings: Scope screen for national scale data sets or in the Regions screen for muti-national data sets. |
Interp(LCDS, UNPopulation, Medium, ARG) |
|
Step
|
|
Step(2000, 300, 2005, 500, 2020, 700) |
|
Remainder |
|
Remainder(100) |
|
Branch and Variable References |
Any LEAP variable can be calculated as a reference to the values of another variable (with some restrictions). |
Passenger: Activity Level * 1.1 |
|
GrowthAs |
GrowthAs calculates a value in any given year based on its previous year's value and the rate of growth in another named branch, raised to the power of an elasticity. In this example the growth in one variable is projected to growth 10% faster than the growth in another key assumption variable named "income". |
GrowthAs(Key\Income,1.1) |



