Page 1 of 1

Count if

Posted: Tue Jan 22, 2013 10:54 am
by flo
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!

Re: Count if

Posted: Tue Jan 22, 2013 2:08 pm
by Administrator
You will need to use something like

Code: Select all

sum ( if then else ( value[range!] = 7 , 1 , 0 ) )

Re: Count if

Posted: Wed Jan 23, 2013 1:44 am
by tomfid
It's not entirely clear what you're counting, but GET DATA TOTAL POINTS might also be useful.

Re: Count if

Posted: Thu Jan 24, 2013 2:17 pm
by flo
The function sum ( if then else ( value[range!] = 7 , 1 , 0 ) ) works perfectly, thanks a lot.