home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!howland.reston.ans.net!usc!cs.utexas.edu!uwm.edu!ogicse!flop.ENGR.ORST.EDU!gaia.ucs.orst.edu!gaia.ucs.orst.edu!news
- From: tpugh@oce.orst.edu (Tim Pugh)
- Newsgroups: comp.sys.next.software
- Subject: Re: selective sums in Improv
- Message-ID: <1glqc7INNm1q@gaia.ucs.orst.edu>
- Date: 15 Dec 92 23:39:51 GMT
- Article-I.D.: gaia.1glqc7INNm1q
- References: <1992Dec1.212243.304@dagobah.fdn.org>
- Reply-To: Tim Pugh <tpugh@oce.orst.edu>
- Organization: University Computing Services - Oregon State University
- Lines: 35
- NNTP-Posting-Host: tsunami.oce.orst.edu
-
- In article <1992Dec1.212243.304@dagobah.fdn.org> yann@dagobah.fdn.org (Yann
- Lechelle) writes:
- > Hi Folks,
- >
- > who knowns how to make a selective sum using Improv ?
- > example:
- >
- > Col 1 Col 2
- >
- > val1 10 x
- > val2 11 x
- > val3 13
- > val4 15 x
- >
- > sum 49 36 <--- something like sum(if(cell=='x',cellValue,0)) ???
- >
- > Thanks for posting an answer.
- >
- > ---
- > / ================================================= \
- > \ Yann Lechelle (Paris, FRANCE) /
- > / yann@dagobah.fdn.org Email/NeXTmail \
- > \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ /
- > / "grep me no patterns and I'll tell you no lines." \
- > \ ================================================= /
-
- And the answer is...
-
- col2:sum = selectsum(col1:Val1 .. col1:Val4 ,col2:Val1 .. col2:Val4 ,"x")
-
- --
- Tim Pugh
- College of Oceanic and Atmospheric Sciences
- Oregon State University
- tpugh@oce.orst.edu
-