| G Wood 2005-02-05, 3:58 am |
| It's been a while since I developed in PB, but a novice user asked me a
question that I considered to be dead-easy. Then I started playing with it,
and wondering...
They have a return set from a complex Oracle query that contains many
columns, two of which they wish to have conditional counts on. The problem
can be illustrated as follows :
Return set :
Parent Child
AAAA 1234
AAAA 2343
AAAA 4334
BBBB 2222
CCDD 3434
The report should correctly count that there are 3 distinct parent values,
and 5 distinct child values. I tried various groupings, computed fields and
expressions, and whatever counts I put on the parent column would always
equal the number of detail rows returned (5 in my example data). I know the
easy answer is to perform the count in the Oracle query, but both columns
are part of an overall GROUP BY clause, so both always return a 1 per row.
I had thought there was a way in PB to compare the current row column value
with the prior row, and set a computed expression to 1 or 0 as a result,
giving me a way to use SUM() to do this. So far I haven't been able to
"rediscover" this.
If it matters, I am using PB 9.x. Any hints appreciated.
Gary
|