Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing and Counting Results

Status
Not open for further replies.

TEM3

Technical User
Dec 6, 2004
324
US
Using Crystal Reports 8.5 and Oracle Tables:

I'm stuck (again)!

I have a table of items (LABITEM) which are tested. The results are placed in a separate table (ARRESULT). The structure of ARRESULT is such that a field {Test Type Code} is populated with the type of test run (there are 100's) and another field {RESULT} is given a value (>0 or not null means the test was positive).

I need to test the condition for an item that two different test results {Test Type Code} are both positive or if one is positive and one is negative. Therefore I have to parse ARRESULT for every record that relates to the LABITEM and test for the two conditions and count either state.

 
You need to parse a table?

I think that you should try posting technical information:

Example data (show field names and data)
Expected results

It may be that you mean that you're experiencing row inflation, and that you'd like to look for various conditions for each labitem and make a decision based on some set of rows associated with them.

If that's the case, why not show the fields, the data, and what the output would be rather than attempting to describe it?

-k
 
shared numbervar MariPos;
shared Numbervar MultiPos;

if {ARRESULT.Test Type Code} = "TXMARI" or {ARRESULT.Test Type Code} = "DRMARI" then
MariPos := 1;

if {ARRESULT.Test Type Code} = "TXBL+MDR" or {ARRESULT.Test Type Code} = "TXUR+MDR" then
MultiPos := 1;



shared numbervar MariPos;
shared numbervar MultiPos;
shared numbervar MariOnly;
shared numbervar MultiDrug;

If MariPos > 0 and MultiPos > 0 then MultiDrug := MultiDrug + 1;

If MultiPos = 0 then MariOnly := MariOnly + 1;


The report is grouped by year, case, item and item type (Blood or Urine). Within the item type group I test for my two conditions (Marijuana only or Marijuana and other drugs in this limited case) and total them, initializing the totals before each new year. It seems to be working, but there has got to be a better way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top