By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,810 Members | 1,601 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,810 IT Pros & Developers. It's quick & easy.

Loop through dataset - check values

P: n/a
Currently I have a dataset that populates as follows (example data):

ID Cycle Drug_Day Name
3 1 1 Initial
3 1 15 Initial
3 2 1 Initial
3 2 15 Initial
3 3 1 Initial
3 3 15 Initial

The problem comes in that currently all this data is being "dumped" to
labels. The labels for the above data would look like this:

C1; D1; Initial
C1; D15; Initial
C2; D1; Initial
C2; D15; Inital
C3; D1; Inital
C3; D15; Inital

They want it better formatted so they look better (understandable).
Well what they want two different checks of the data be ran. First
check would see if all the Cycles had identical data (as-is the case
above) and in that case the display then would be:

Cx; D1, 15; Initial (the x meaning "all cycles" and the days grouped to
minimize space)

The second check they want ran is on the "name" column. With the data
above; they all have the same values; but sometimes it will have
different values. So if those are different; they want them broken out;
but grouped together as much as possible. So in the above data example
I'll change the data a little bit:

ID Cycle Drug_Day Name
3 1 1 Initial
3 1 15 Initial
3 2 1 Initial
3 2 15 Sequential
3 3 1 Initial
3 3 15 Initial
So now the readout on the labels should be:
C1; D1, 15; Initial
C2; D1; Initial
C2; D15; Sequential
C3; D1, 15; Initial

So what I need is a check on all the rows of the dataset and then change
the data in the dataset depending on what is the same. Does that make
sense? The hard part is that the data are going to change heavily.
Sometimes more than 3 cycles; sometimes more than 2 different drug days;
sometimes the "name" field will change. so I'm having difficulty coming
up with the logic to run through the rows and compare the different
rows. Any help would be much welcomed.
Jul 24 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.