Welcome to WEAP's Website WEAP
WEAP is an initiative of the Stockholm Environment Institute.


About WEAP

Home
Why WEAP?
Features
What's New?
Sample Screens
Demonstration
Publications
History and Credits

Using WEAP
Download
Licensing
User Guide
Tutorial
Videos (YouTube)

User Forum
Discussions
Members List
Edit Profile

Additional Support
Training
University Courses
Collaboration

About Us
SEI-US Water Resources Program
Please Contact Us

Environmental News
Not acting like themselves: Antidepressants in environment alter crayf...
Expose crayfish to antidepressants, and they become more outgoing -- but that might not be such a positive thing for the...

Use of PFAS in cosmetics 'widespread,' new study finds
Many cosmetics sold in the United States and Canada likely contain high levels of per- and polyfluoroalkyl substances (P...

Baltic herring larvae appear earlier and grow faster due to climate ch...
Conditions during Baltic herring spawning may have cascading effects on the whole Baltic ecosystem.
Source: Science Daily
LEAP
Interested in Energy?
Read about LEAP: SEI's software for energy planning.

Link WEAP and LEAP for combined Water-Energy planning.
Watch a video demo!
   

User Forum

All Topics | Topic "WEAP API: Need array of all values in all years"
Log in to post new messages or reply to existing messages.
 
Author Message
Mr. Yatharth Sharma

Subject: WEAP API: Need array of all values in all years   
Posted: 8/24/2017 Viewed: 5372 times
Hi,

I am trying to use WEAP API to run a scenario. I am using
PRINT WEAP.ResultValue("\Demand Sites\West City:Unmet Demand[Cubic Feet]", 2015, 1, "Reference", 2015, WEAP.NumTimeSteps)

But it prints only the sum/avg etc of all the values.

What I need is a year by year value to be returned
something like: [10,11,12,13,14]

How can I get the same?
Thanks in advance
Mr. Jack Sieber

Subject: Re: WEAP API: Need array of all values in all years   
Posted: 9/13/2017 Viewed: 5352 times
There is no WEAP API function that will return multiple values. WEAP.ResultValue returns a single value, which can be for one timestep, or the sum/average/max/min for a range of timestep values.

Here is how to print the result values for 2015:

for ts = 1 to WEAP.NumTimeSteps
Print WEAP.ResultValue("\Demand Sites\West City:Unmet Demand[Cubic Feet]", 2015, ts, "Reference")
next
Topic "WEAP API: Need array of all values in all years"