Discussion:
Sum an expression in the summary band
(too old to reply)
unknown
2010-01-13 23:48:24 UTC
Permalink
I have a computed field written as: if( total_entries
=1,1,0) which sits within the trailer group #1 band (this
expression works correctly). I want to sum those values (so
it will be summing a bunch of 1's or 0's). I created an
expression written as: sum(if( total_entries >=1,1,0) for
all) that is in the summary band.

The problem I have is that the "sum" expression sums up all
the values within the the Detail band and gives me a much
higher number than I want - it doesn't just take the 1 or 0
computed in the summary band. I've tried playing around w/
the groups I tried this expression: sum(if( total_entries
=1,1,0) for group 1) but that still doesn't work because it
then just gives me unique entries within group 1 - it
doesn't sum up the 1's and 0's either. Any ideas???
Terry Dykstra [TeamSybase]
2010-01-20 17:17:36 UTC
Permalink
The computed field as you have it in the group 1 band is logically not
correct:
if( total_entries>=1,1,0)
It will only look at the last row in the detail band for that group. Is
total_entries an aggregate field?
--
Terry Dykstra (TeamSybase)
http://powerbuilder.codeXchange.sybase.com/
http://casexpress.sybase.com
product enhancement requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement
Post by unknown
I have a computed field written as: if( total_entries
=1,1,0) which sits within the trailer group #1 band (this
expression works correctly). I want to sum those values (so
it will be summing a bunch of 1's or 0's). I created an
expression written as: sum(if( total_entries >=1,1,0) for
all) that is in the summary band.
The problem I have is that the "sum" expression sums up all
the values within the the Detail band and gives me a much
higher number than I want - it doesn't just take the 1 or 0
computed in the summary band. I've tried playing around w/
the groups I tried this expression: sum(if( total_entries
=1,1,0) for group 1) but that still doesn't work because it
then just gives me unique entries within group 1 - it
doesn't sum up the 1's and 0's either. Any ideas???
Loading...