Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need help for below requirement. Post Reply Post New Topic
Author Message
me_salman148
Newbie
Newbie
Avatar

Joined: 16 Oct 2012
Location: India
Online Status: Offline
Posts: 6
Quote me_salman148 Replybullet Topic: Need help for below requirement.
     Posted: 24 Dec 2013 at 12:07am
I need to implement a 'Countif' function from Excel in crystal report.

As you know Countif function will count the same values and display the result(Count) where ever the value is located.

Name Countif
A        3
A        3
B        2
C        1
A        3
B        2
D        1


So how can I implement this in Crystal reports.

I need to display this at GF4 level.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 24 Dec 2013 at 12:38am
hi

YOu need to insert a group on Name and count the elements.

If you suppress details then it will display in group gooter.


Thanks,
Sastry
IP IP Logged
me_salman148
Newbie
Newbie
Avatar

Joined: 16 Oct 2012
Location: India
Online Status: Offline
Posts: 6
Quote me_salman148 Replybullet Posted: 24 Dec 2013 at 12:56am
Hi Sastry, please check the below example.

Column 1        Column 2        Count
xxxx1           yyyy1             0.33
xxxx2           yyyy2             1
xxxx3           yyyy3             0.5
xxxx4           yyyy1             0.33
xxxx5           yyyy1             0.33
xxxx6           yyyy3             0.5

in the above example we have 3 yyyy1 and 2 yyyy3... so for those records we have to display 1/3 for yyyy1 and 1/2 for yyyy3 and 1/1 for yyyy2... This should be done for all records in the report having similar column 2 values.

Is there any crystal function that i can use.




IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 24 Dec 2013 at 1:36am
Hi

If your column2 values are in some sort order then it is possible to have some group and count it.

Give me all group information also, so that we can check any other way we can display this.

There is no countif() equivalent function in crystal

-Sastry
Thanks,
Sastry
IP IP Logged
me_salman148
Newbie
Newbie
Avatar

Joined: 16 Oct 2012
Location: India
Online Status: Offline
Posts: 6
Quote me_salman148 Replybullet Posted: 24 Dec 2013 at 1:44am
No they are not in same sort order. There are 4 groups and we have to do this is GF4. Gf4 is on column2 and remaining 3 groups are on different columns.

Also we need count of the column 2 values present in group 4,
for example count of yyyy2 is 2 in group 4 and 5 when we consider detail section.

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Dec 2013 at 5:26am
I think that if you add a cross-tabs into your group footer and have it count based on the last digit of the year, that you should get what you are after.

or a subreport (though I try to avoid subreports)
IP IP Logged
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