Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2020
:
Technical Questions
Topic: How to calculate percentage in Crystal Report
Oldest Post First
Newest Post First
Author
Message
Jancy
Newbie
Joined: 22 Jul 2010
Online Status: Offline
Posts: 4
Topic: How to calculate percentage in Crystal Report
Posted: 22 Jul 2010 at 7:38pm
hi,
In my report i need to calculate percentage of each group. How to write formula to calculate percentage like below mention.
Eg:
Name Subjects Marks Percentage
John English 100
Maths 50
Science 50
Total A 200 (Total A/ Total A + Total B) * 100
Klin English 50
Maths 50
Science 50
Total B 150 (Total B/ Total A + Total B) * 100
Please help me to write a formula for this.
Thanks in advance
Jancy
Edited by Jancy - 22 Jul 2010 at 7:42pm
IP Logged
Emir_W
Senior Member
Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Posted: 23 Jul 2010 at 3:11am
i assume you've grouped the report based on the name.
so, you can create some formulas to calculate it.
formula to calculate 'mark' per group (
@totgrp
):
sum({tbl.mark},{tbl.name})
formula to calculate for all (
@totall
):
sum({tbl.mark})
then calculate the total that you request (@totpercentage):
(
{@totgrp
} /
{@totall
}) * 100
and put
{@totpercentagate
} in group footer (GF).
hope it help.
Emir W
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 23 Jul 2010 at 4:28am
also assuming you grouped on name you can also use an insert summary
click on the insert summary button (sigma sign )
select the 'Percentage' value field
Select to reset at the group level
change the last option to show as a percentage of the whole
IP Logged
Jancy
Newbie
Joined: 22 Jul 2010
Online Status: Offline
Posts: 4
Posted: 27 Jul 2010 at 12:56am
hi,
this formula is working if we have both @totgrp and @total are same section.
Here @totgrp is displays in Groupheader footer and @total we are putting in report footer.
so we i apply formula like this it is not getting @total. What we do for this
IP Logged
Emir_W
Senior Member
Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Posted: 27 Jul 2010 at 1:19am
you can drag n drop both formula (
{@totgrp
} and
{@totall
}) from Group Footer to Group Header section.
hope it hep.
Edited by Emir_W - 27 Jul 2010 at 1:25am
Emir W
IP Logged
Jancy
Newbie
Joined: 22 Jul 2010
Online Status: Offline
Posts: 4
Posted: 27 Jul 2010 at 1:40am
Hi emir,
@total is the running total of each student. If i drag and drop that will show individual student total.
like
Name Subjects Marks Percentage
John English 100
Maths 50
Science 50
Total A 200 (Total A/ Total A + Total B) * 100
@total=200
Klin English 50
Maths 50
Science 50
Total B 150 (Total B/ Total A + Total B) * 100
@total=350
IP Logged
Emir_W
Senior Member
Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Posted: 27 Jul 2010 at 2:28am
i'm creating a report using your data and here is my result.
before drag n drop to Group Header:
---------------------------------------------
name subject mark percentage
john
john english 100
john math 50
john science 50
total john: 200 50.63
klin
klin english 50
klin math 72
klin science 73
total klin: 195 49.37
Grand Total 395
=============================================
after drag n drop to Group Header:
---------------------------------------------
name subject mark percentage
john
200
50.63
john english 100
john math 50
john science 50
klin
195 49.37
klin english 50
klin math 72
klin science 73
Grand Total 395
hope it help.
Edited by Emir_W - 27 Jul 2010 at 2:29am
Emir W
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
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.047 seconds.
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
CLICK PLAYS
|
COACH FORUMS
|
TROPICAL FISH
© 2004-2024 Brian Bischof. All Rights Reserved.