• 121 views | 4 messages Discussion: LEAP
    Topic: Calculations among RegionsSubscribe | Previous | Next
  • Moustafa Sharshar 5/20/2018

    Greetings!

    I Like to add or subtract values from different regions and different scenarios, Like to subtract the effect (demand) of one region using specific scenario from the world ( another region) and add another demand value) for the same region but from different scenario. It will be like

    World (Coal demand in mitigation Scenario)= World(coal demand in Reference Scenario)- Any Region (coal demand in Reference Scenario)+Any Region (coal demand in Migitation Scenario)

    Can I do the same calculation Using Leap or not?

    Thanks,
    Moustafa

  • Emily Ghosh 5/22/2018
      Best Response

    Hi Moustafa,

    You can use the ScenarioValue function to reference the value from another scenario within the same region and the RegionValue function to reference the value from another region within the same scenario.

    While there isn't a built-in LEAP function to reference another region in another scenario (Any Region/Reference Scenario), there is an indirect way to do this through the creation of a User-Variable. For example, you could create a User-Variable, and then in each region, enter an expression which references a value in another scenario through the ScenarioValue function. Then, in your coal demand expression, you could reference this new User-Variable using the RegionValue function.

    To give you a better idea of what I mean, here are example expressions for the user-variable and coal demand in the Mitigation scenario. This example assumes that your coal demands are entered in the Total Energy variable:

    • User Variable expression in Mitigation Scenario in Region X: ScenarioValue(Demand\Electricity:Total Energy[MWh],Baseline)
    • Total Energy Demand expression in Mitigation Scenario in World (based on the formula you provided in your post): ScenarioValue(Baseline) - RegionValue(Demand\Electricity:UserVariable[MWh],Region X) + RegionValue(Demand\Electricity:Total Energy[MWh],Region X)
    Hope this helps!
    Emily

  • Moustafa Sharshar 5/22/2018
      Best Response

    Hi Emily,

    I have tried your solution and it works. Thank you. I was about to calculate the values in excel and then manual add it to leap model. Thank you for saving my time. I am very grateful.

    Thanks,
    Moustafa

  • Emily Ghosh 5/23/2018
      Best Response

    1 Like

    No problem! I'm happy to help.

    Best regards,
    Emily