• 185 views | 4 messages Discussion: LEAP
    Topic: Combining multiple functions in expressionsSubscribe | Previous | Next
  • Deleted User 3/24/2020

    Hello.

    I was wondering is it possible to combine multiple functions in one expression?
    I have a model with a base year 2015, and that model has been updated (mostly using interp fuction) to accurately reflect data up to 2019. Now, I'd like to use the same model for projections up to 2050.
    So my question is, if I have a key parameter defined in Current accounts like "Interp(2015; 100; 2019; 120)", can I somehow combine it with GrowthAs function after 2019? So the year 2020 is calculated like 2019 * (1 + growth factor), but the previous years are calculated using the stated interpolation?

    Best regards,
    Filip

  • Charlie Heaps 3/24/2020
      Best Response

    >>is it possible to combine multiple functions in one expression... If I have a key parameter defined in Current accounts like "Interp(2015; 100; 2019; 120)", can I somehow combine it with GrowthAs function after 2019?

    Hi Filip, Try something like this:

    If(year < 2020,
    Interp(2015, 100, 2019, 120),
    GrowthAs(Key\GDP)
    )

    Or rewritten for your number formatting (with semi colons as separators):

    If(year < 2020;
    Interp(2015; 100; 2019; 120);
    GrowthAs(Key\GDP)
    )

    One thing to note: if you edit the functions in the Builder window you can write the equation across multiple lines (making them easier to read). Once you submit them, they will look like this in the main data entry table...
    If(year < 2020, ~ Interp(2015, 100, 2019, 120),~ GrowthAs(Key\GDP)~)

    Best of luck!

    Charlie

  • Deleted User 3/24/2020
      Best Response

    Mr. Heaps, thank you a lot, I didn't know I could use logical operators in expressions!
    :)
    Best regards,
    Filip

  • Charlie Heaps 3/24/2020
      Best Response

    1 Like

    :)