Hey there,
I'm using Vensim DSS and what I try to do is to create (or use an existing?) function that works he way the "COUNT IF"-Command in IBM SPSS or MS Excel does. The model is connected to database and i want to count the number of certain values in the database list (for example COUNT IF VALUE=7). Is that somehow possible?
Thanks a lot!
Count if
-
- Super Administrator
- Posts: 4611
- Joined: Wed Mar 05, 2003 3:10 am
Re: Count if
You will need to use something like
Code: Select all
sum ( if then else ( value[range!] = 7 , 1 , 0 ) )
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Count if
It's not entirely clear what you're counting, but GET DATA TOTAL POINTS might also be useful.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Count if
The function sum ( if then else ( value[range!] = 7 , 1 , 0 ) ) works perfectly, thanks a lot.