cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Creating count from queried fields

Former Member
0 Likes
1,053

Post Author: John

CA Forum: Formula

Hello all. Newbie here to the forum and CR.

Running CR 9

I have a report that extracts certain data from the database. A field that displays "test code", is not part of the original search criteria. I have been asked to total "test code" but, I don't know how to count the records from the extracted data.

For example, I'm pulling in everyone with a last name that begins with a "J" and who came in the store from 01/01/07 - 01/31/07. I then list the data and also print their address, city, state, zip, and "test code". The "test code" is one of 3 possible codes. I want to have 1 running total for each of these 3.

My knowledge allows me to create a running total on the field but, the total is from ALL of the records that match.

So, if we had 45 people with "J" and 01/01/07 - 01/31/07, the running total will be 67 because it is finding all data sets that match it's code. It isn't pulling from the original search criteria of "J" and 01/01/07 - 01/31/07.

Any help is appreciated.

John

View Entire Topic
Former Member
0 Likes

Post Author: John

CA Forum: Formula

Here is the best example I can give as I work for a hospital and I am not allowed to give patient data.

Store #1

1234556 (Account #)

Steven, Peter Bag of Rocks (Product ID) 4344211 (Amount) 4.50

Steven, Peter Bag of Salt 3433322 5.60

Steven, Peter Bag of Rocks 4344211 4.50

23497345

Peter, Steven Bag of Rocks 4344211 4.50

Peter, Steven Case of Beer 1325454 8.00

Peter, Steven Bag of Rocks 4344211 4.50

(At bottom of report) # of 4344211 Products = ? (This is where I need to put the total in.) (In the above example, the total should be 4)

In my current total... if I put the total in the detail section (Next to the Product ID)... I get a total of 1 for the first and then 7 for the second and so on. If I put the total in the GF2 section, I would get a total of 2. I'm assuming this is due to the # of account #'s. If you put the total in GF1... you get a total of 1 because it is counting the store. (Or so I think)

Hope this helps.

Thanks