Discussion:
How do you add a conditional counter?
(too old to reply)
unknown
2010-01-21 00:11:21 UTC
Permalink
Hello,
I work in a medical field where patients come for treatment
every week day, for a number of weeks. This is scheduled in
a database. (call this date scheduled_date).
On some treatment dates we have the patients take xrays.
There may be 1, 2 or 3 taken on any particulate treatment
date. Each image taken is time stamped (call this
image_date). Each image is given a unique name (image_name).

I want to be able to create a report where, if the
schedule_date = image_date, then a count will increase by 1,
and then reset for the next day. Essentially, I want to
count the number of images taken on any particular day.

At the moment I have grouped my report, 1st level is the
schedule_date, then the 2nd level is image_date, then the
third is image_name. There is a computed field in the
image_name header that display 1 if the image date and the
schedule date are the same, and 0 if they are not. I
intended to sum the counter for each scheduled date. This is
where I fall into a hole.

I am not very familiar with infomaker, and trying to teach
myself at the same time as writing this report (with little
success).

Any suggestions would be helpful.
Regards
Vincent
Terry Dykstra [TeamSybase]
2010-01-21 23:43:05 UTC
Permalink
Just trying to understand your data a bit better. Does it look something
like this?

patientid schedule_date image_date
1 2010/01/10 2010/01/10 9:00AM
1 2010/01/10 2010/01/10 9:30AM
1 2010/01/10 2010/01/10 10:30AM
2 2010/01/11
3 2010/01/11 2010/01/11 10:00AM
4 2010/01/11 2010/01/11 9:00AM
4 2010/01/11 2010/01/11 9:30AM

In your report, are you sorting by the patient id, or purely by the
schedule_date?
If you give me an example of the data and how you want the report to look, I
can probably figure out how to set up the grouping and the counters. Right
now I'm a bit confused.
--
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
Hello,
I work in a medical field where patients come for treatment
every week day, for a number of weeks. This is scheduled in
a database. (call this date scheduled_date).
On some treatment dates we have the patients take xrays.
There may be 1, 2 or 3 taken on any particulate treatment
date. Each image taken is time stamped (call this
image_date). Each image is given a unique name (image_name).
I want to be able to create a report where, if the
schedule_date = image_date, then a count will increase by 1,
and then reset for the next day. Essentially, I want to
count the number of images taken on any particular day.
At the moment I have grouped my report, 1st level is the
schedule_date, then the 2nd level is image_date, then the
third is image_name. There is a computed field in the
image_name header that display 1 if the image date and the
schedule date are the same, and 0 if they are not. I
intended to sum the counter for each scheduled date. This is
where I fall into a hole.
I am not very familiar with infomaker, and trying to teach
myself at the same time as writing this report (with little
success).
Any suggestions would be helpful.
Regards
Vincent
unknown
2010-01-21 23:57:30 UTC
Permalink
An update to what I have been trying. only just managed it a
few minutes ago. It comes down to the good old way you link
the tables. I have managed to find a much easir way to link
the tables, which actually has the schedule table and image
table linked in a more direct way, and this seems to have
solved my problem. Then the grouping becomes a simple
matter.

Thankyou Terry for taking this up, but I think it is a
simple case of the operator not understanding his tools.
Sorry for wasting your time.

On a side note, it looks like you have the data looking
right.
I am filtering the data down so that it only looks at one
patient, via their patientid. So in the example that you
provided, I would look at, say, patient 1 only.

Vincent
Post by Terry Dykstra [TeamSybase]
Just trying to understand your data a bit better. Does it
look something like this?
patientid schedule_date image_date
1 2010/01/10 2010/01/10 9:00AM
1 2010/01/10 2010/01/10 9:30AM
1 2010/01/10 2010/01/10 10:30AM
2 2010/01/11
3 2010/01/11 2010/01/11 10:00AM
4 2010/01/11 2010/01/11 9:00AM
4 2010/01/11 2010/01/11 9:30AM
In your report, are you sorting by the patient id, or
purely by the schedule_date?
If you give me an example of the data and how you want the
report to look, I can probably figure out how to set up
the grouping and the counters. Right now I'm a bit
confused.
--
Terry Dykstra (TeamSybase)
http://powerbuilder.codeXchange.sybase.com/
http://casexpress.sybase.com
http://my.isug.com/cgi-bin/1/c/submit_enhancement
Post by unknown
Hello,
I work in a medical field where patients come for
treatment every week day, for a number of weeks. This is
scheduled in a database. (call this date
scheduled_date). On some treatment dates we have the
patients take xrays. There may be 1, 2 or 3 taken on any
particulate treatment date. Each image taken is time
stamped (call this image_date). Each image is given a
unique name (image_name). >
Post by unknown
I want to be able to create a report where, if the
schedule_date = image_date, then a count will increase
by 1, and then reset for the next day. Essentially, I
want to count the number of images taken on any
particular day. >
Post by unknown
At the moment I have grouped my report, 1st level is the
schedule_date, then the 2nd level is image_date, then
the third is image_name. There is a computed field in
the image_name header that display 1 if the image date
and the schedule date are the same, and 0 if they are
not. I intended to sum the counter for each scheduled
date. This is where I fall into a hole.
I am not very familiar with infomaker, and trying to
teach myself at the same time as writing this report
(with little success).
Any suggestions would be helpful.
Regards
Vincent
Loading...