Well spotted, SUMMATION() will add all the value entities -
summation(gts(field,reuse(0)))
S

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Anthony W.
Youngman
Sent: Friday, 8 January 2010 07:45
To: [email protected]
Subject: Re: [U2] Count question

In message 
<[email protected]>, 
"Boydell, Stuart" <[email protected]> writes
>Whoops - forgot the reuse function:
>LIST MY.FILE EVAL "SUM(GTS(MY.MV.FIELD,REUSE(0)))"

In this instance you might need SUM() twice ...

Note that when the example was provided it had two values each with four

sub-values

0011: 4|0|0|0}4|23|4|0

iirc your eval will return 1}3. So the eval actually needs to be

LIST MY.FILE EVAL "SUM(SUM(GTS(MY.MV.FIELD,REUSE(0))))"

Cheers,
Wol
>
>eg
>LIST GRTRANS EVAL "SUM(GTS(REC.QTY,REUSE(0)))" FMT "10R" REC.QTY
>  G3878180                    1      1
>  G4678192                    1      2
>   1867500                    4      1
>                                     4
>                                     6
>                                     1
>  G4078183                    2      3
>                                     3
>...
>
>Stuart Boydell
>-----Original Message-----
>
>Hi all,
>
>Using UniVerse 9.6 on AIX4.1,
>
>I'm trying to write a routine to count the number of occurrences of
>values > than 0, for example,
>
>against this attribute:
>
>
>
>0011: 4|0|0|0}4|23|4|0
>
>
>
>I'd like to return a value of '4' for the 4 values > 0.
>
>Not having much luck with COUNT or DCOUNT.
>
>
>
>Any help is greatly appreciated.
>
>
>
>Ed Hess
>
>
>
>
>
>_______________________________________________
>U2-Users mailing list
>[email protected]
>http://listserver.u2ug.org/mailman/listinfo/u2-users
>
>***********************************************************************
*
>******************************
>This email message and any files transmitted with it are confidential 
>and intended solely for the use of addressed recipient(s). If you have 
>received this communication in error, please reply to this e-mail to 
>notify the sender of its incorrect delivery and then delete it and your

>reply.  It is your responsibility to check this email and any 
>attachments for viruses and defects before opening or sending them on. 
>Spotless collects information about you to provide and market our 
>services. For information about use, disclosure and access, see our 
>privacy policy at http://www.spotless.com.au
>Please consider our environment before printing this email.
>***********************************************************************
*
>******************************
>_______________________________________________
>U2-Users mailing list
>[email protected]
>http://listserver.u2ug.org/mailman/listinfo/u2-users

-- 
Anthony W. Youngman <[email protected]>
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The
man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - <http://www.maverick-dbms.org> Open Source
Pick
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to