Print Page | Close Window

Problem to calculate formula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19976
Printed Date: 02 May 2024 at 11:34pm


Topic: Problem to calculate formula
Posted By: fsilvabrasil
Subject: Problem to calculate formula
Date Posted: 03 Sep 2013 at 2:09am
Hello

Good day.

I'm having problems with formulas in crystal'm new to the program, I have to create a formula that has to sum ​​the values​​.

I created a formula to sum​​.
1
1
3
1
1
1
2
3
1
2

total = 16

more is not the correct value for the report is that the sum certain.

1
1
3
1
1
1
2
3
1
2

total = 10
it not only sums the values ​​that two or more.

version of Crystal Reports XI



Replies:
Posted By: praveeng
Date Posted: 03 Sep 2013 at 2:32am

Hi,

What is the formula you are using for sum?
What is your exact requirement?
Do you want to show total as 10 or 16??
 
--Praveen G


-------------
Praveen Guntuka,
praveen_guntuka@yahoo.com


Posted By: fsilvabrasil
Date Posted: 03 Sep 2013 at 3:01am
Hi the formula I'm using is this?

numberVar i: = 0;

if (AGR_FALTA_ATESTADOS_V.FALTAS {})> 0
   then i: = i +1


when do sum of formula field it shows the value that I want is 10, not 16.


Posted By: praveeng
Date Posted: 03 Sep 2013 at 3:16am

Hi,

Using above formula, it will count the number of  {AGR_FALTA_ATESTADOS_V.FALTAS} in the report/section.
In which section have you placed the above formula?
Do you need sum of the formula output or Count of the formula output?
 
--Praveen G


-------------
Praveen Guntuka,
praveen_guntuka@yahoo.com


Posted By: fsilvabrasil
Date Posted: 03 Sep 2013 at 3:51am
Yes, I use it in the Group Footer section # 3

how do the sum of production formula and how do I count the output.


Posted By: fsilvabrasil
Date Posted: 03 Sep 2013 at 3:57am
Yes, I use it in the Group Footer section # 3

how do the sum of production formula and how do I count the output.


Posted By: praveeng
Date Posted: 04 Sep 2013 at 3:31am
Hi,
 
Right click on the formula which is placed on Group Footer Section # 3.
Select Insert option then Insert Summary window will pops-up.
In Calculate this Summary drop-down box select Count and Summary Location as  Report Footer/Page Footer
Then Click on OK
--Praveen G


-------------
Praveen Guntuka,
praveen_guntuka@yahoo.com


Posted By: fsilvabrasil
Date Posted: 05 Sep 2013 at 2:16am
good day
Friend did not give the correct result did more failed to calculate the value in the operation shows the value of 3.374.


Posted By: fsilvabrasil
Date Posted: 10 Sep 2013 at 7:00am
Hello

Dear friends.

have someone else to help with this doubt.

Grateful to all who help.


Posted By: kevlray
Date Posted: 10 Sep 2013 at 7:50am
I am reading over this thread and wondering how you got a decimal (3.373) when doing count?!?  Counts are always integer.


Posted By: fsilvabrasil
Date Posted: 10 Sep 2013 at 8:02am
This is what the friend, you have a solution to this problem.


Posted By: fsilvabrasil
Date Posted: 10 Sep 2013 at 8:04am
Originally posted by kevlray

I am reading over this thread and wondering how you got a decimal (3.373) when doing count?!?  Counts are always integer.






This is what the friend, you have a solution to this problem.


Posted By: fsilvabrasil
Date Posted: 10 Sep 2013 at 8:04am
This is what the friend, you have a solution to this problem.


Posted By: kevlray
Date Posted: 10 Sep 2013 at 12:01pm
Apparently you are not doing a count, what kind of aggregation are you doing? 


Posted By: fsilvabrasil
Date Posted: 11 Sep 2013 at 1:59am
What I did was the formula below.

numberVar i: = 0;

if (AGR_FALTA_ATESTADOS_V.FALTAS {})> 0
   then i: = i +1


and put in the Group Footer # 3.

so that it shows the value 16 and not 10 that correct.


Posted By: kevlray
Date Posted: 11 Sep 2013 at 6:15am
I am not sure what AGR_FALTA_ATESTADOS_V.FALTAS {} is (It does not appear to be the standard format for a field, running total, etc.).  Normally I use a running total to do counts and use a a formula to evaluate.

I hope this helps.


Posted By: fsilvabrasil
Date Posted: 17 Sep 2013 at 3:25am
Hello, Good Day

Someone else to help solve this problem.


Grateful to all.


Posted By: DBlank
Date Posted: 17 Sep 2013 at 3:35am
numberVar i: = 0;

if (AGR_FALTA_ATESTADOS_V.FALTAS )> 1
   then i: = i + (AGR_FALTA_ATESTADOS_V.FALTAS)


Posted By: fsilvabrasil
Date Posted: 17 Sep 2013 at 3:57am
Hello, Dear Friends

Yet the problem with your formula as use and put in Group Footer it brings no value. values ​​appear zero. and when do sum it shows zero not all right.


Posted By: DBlank
Date Posted: 17 Sep 2013 at 4:01am
lets make this easier
go to Running totals
right click
select new
name = SumGreaterOne
field to summarize=AGR_FALTA_ATESTADOS_V.FALTAS
type=sum
evlaute= use a formula
AGR_FALTA_ATESTADOS_V.FALTAS>1
reset=group1
place this RT in the group footer


Posted By: fsilvabrasil
Date Posted: 17 Sep 2013 at 4:15am
Grateful for the information it brings over the blank shows no value.

Thank you, most will not give up we will solve.


Posted By: DBlank
Date Posted: 17 Sep 2013 at 4:19am
go into the running total evaluate formula and change the pick option to 'use default values for nulls' 


Posted By: fsilvabrasil
Date Posted: 18 Sep 2013 at 3:27am
good day

dear friend how would this procedure for the operation executable rights.

I am beginner with crystal reports.


Posted By: fsilvabrasil
Date Posted: 25 Sep 2013 at 2:58am
Hello

Dear friends someone else to help with this problem you can not solve.

urgent.


Posted By: kostya1122
Date Posted: 30 Sep 2013 at 1:00pm
try this
formula 1
if tonumber((AGR_FALTA_ATESTADOS_V.FALTAS {})  > 1
then
tonumber((AGR_FALTA_ATESTADOS_V.FALTAS {})
else 0

formula 2
sum(formula 1 , group)






Posted By: fsilvabrasil
Date Posted: 04 Oct 2013 at 3:46am
good day

ok dear friend try


Posted By: fsilvabrasil
Date Posted: 07 Oct 2013 at 3:13am
Hello

thanks for the tip dear friend over the result given the previous value as the other formulas. novelty thank you.



Print Page | Close Window