Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Count formula for number of records in a Group Post Reply Post New Topic
Author Message
karenb
Newbie
Newbie


Joined: 03 Oct 2007
Location: Australia
Online Status: Offline
Posts: 10
Quote karenb Replybullet Topic: Count formula for number of records in a Group
    Posted: 07 Aug 2016 at 9:08pm
Hi there

I am grouping my report in two levels:

Group1: Object Category
then
Group2: Object Location

At the Group2 Object Location level I want to show a count of how many objects are there in that Group2 location, under that Group1 category.

I've tried putting a running total field in the Group2 footer and, but don't seem to be able to get the correct counts out. I also tried doing a simple formula field with "count" commmand in it but that didn't work either.

Can anyone suggest what I'm doing wrong?

cheers
Karen

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 08 Aug 2016 at 6:14am
When you say 'a count of how many objects are there', did you want a row count or something else?  Counts can be a bit tricky if you have duplicated values and/or have conditionally suppressed details.  Can you provide further information on what you are counting?
IP IP Logged
karenb
Newbie
Newbie


Joined: 03 Oct 2007
Location: Australia
Online Status: Offline
Posts: 10
Quote karenb Replybullet Posted: 08 Aug 2016 at 1:18pm
Hi there Kevlray, thanks for your reply..

I am retrieving a bunch of records, each containing a value in the "Object Category" field and a value in the "Object Location" field. I then want to run a report that will show me for each Object Category, how many records are in each Object Location. I am grouping the report by Object Category and then by Object Location. Within each Object Category group, I want to show how many objects (records) are in each Object Location group. No iteration of the running total field is counting it properly for me!

Here's an example data sample:

Record 1
Object Category = Agriculture
Object Location = Basement1

Record 2
Object Category = Agriculture
Object Location = Basement1

Record 3
Object Category = Models
Object Location = Basement1

Record 4
Object Category = Models
Object Location = Basement3

So then I want the output to be grouped like this:

Object Category: AGRICULTURE
Object Location: Basement1
No of Objects: 2

Object Category: MODELS
Object Location: Basement1
No of Objects: 1
Object Location: Basement3
No of Objects: 1

Too put it simply I just want to count the number of object records that occur within each Object Location Group.

I think it should be pretty simple to do but it's just not working for me!
cheers
Karen


Edited by karenb - 08 Aug 2016 at 1:30pm
IP IP Logged
karenb
Newbie
Newbie


Joined: 03 Oct 2007
Location: Australia
Online Status: Offline
Posts: 10
Quote karenb Replybullet Posted: 08 Aug 2016 at 1:59pm
Hi again...

Suddenly this morning I seem to have hit upon the right approach in my Running Total (in the Object Location Group Footer)..

Summarise: Object Record identifier
Type of Summary: Distinct Count
Evaluation: For each record
Reset: On change of group -> Object Location

This seems to be counting correctly now! Perhaps I hadn't tried this combination.

I'll leave this open until I am convinced it really is working :-)

cheers for your help
Karen


Edited by karenb - 08 Aug 2016 at 1:59pm
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 09 Aug 2016 at 5:20am
The running total that you created appears to be correct.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.