Maximum of a variable

Use this forum to post Vensim related questions.
Post Reply
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Maximum of a variable

Post by nikvyas »

Hello all.

I realise that there is a GET DATA MAX that produces the maximum of a data range. However, I want to get a continuous account of the maximum of a variable. For instance, if a variable were to output the following sequence:

12,7,13,1,0,23,2,12,2,34

I would want another variable to give:

12,12,13,13,13,23,23,23,23,34

I can think of many long winded ways of doing it, but was wondering if there was a more elegant solution.

Thanks

Nik
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Maximum of a variable

Post by Administrator »

try

running max of some var =
SAMPLE IF TRUE ( some var > running max of some var , some var , some var )
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Re: Maximum of a variable

Post by nikvyas »

Perfect! Thanks very much.

Nik
Post Reply