Aggregate by month

Use this forum to post Vensim related questions.
Post Reply
Tod
Newbie
Posts: 1
Joined: Thu Dec 06, 2007 6:39 pm

Aggregate by month

Post by Tod »

Hi,
I'm new to the forum and relatively new to vensim.
I am working on a TBL tourism model that uses months. I am searching for a way to aggregate a variable so that it cumulates by month across the course of a model (ie all the data for jan cumulates, all data for feb cumulates, etc). I have tried the CUMULATE function but I am feeding in auxileries, not data. I can get away with using a series of delays but given that the model will be 20 years long, this is an ugly option.
Is there a function or other method I can use?
Any advice would be appreciated. Great to find a place for these kinds of questions.
Cheers, Tod
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

You can use

cum january = INTEG(IF THEN ELSE(Modulo(Time,12) < 0.9999,value,0),0)
cum february = INTEG(IF THEN ELSE(modulo(Time+11,12)<0.9999,value,0),0)

and so on - with Pro/DSS

month: (m1-m12)
cum value[month] = INTEG(IF THEN ELSE(MODULO(time-month+11,12) < 0.999,value,0),0)

This assumes Time runs from 0 and 0 is January 1 - otherwise adjust accordingly.
Post Reply