Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: please help me how to write the formula Post Reply Post New Topic
Author Message
Padma
Newbie
Newbie
Avatar

Joined: 09 Sep 2010
Location: India
Online Status: Offline
Posts: 20
Quote Padma Replybullet Topic: please help me how to write the formula
     Posted: 14 Feb 2012 at 4:30am
Hi,
 
Im find it difficult  to multiply the formula feilds to get the result.
 
Example.
 
i have 4 formula feilds:
 
A= contains quantity1 values
B = contains quantity2 values
C= contains rate values
D = formula field
 
I would like to print the result in this calulation
result = (A-B )*C
 
say A= 140,B =100, c=5
D = (140-100) * 5 = 40 *5 = 200.
 
please help me drive this .
 
Many thanks,
Padma
 
 
 
 
priya
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 14 Feb 2012 at 4:51am

D =

 
({a}-{b})*{c}
 
I thought it may seem a little condescending typing that given that you've already types the formula out yourself pretty much but there's nothing else to it.
 
Regards,
Ryan.


Edited by rkrowland - 14 Feb 2012 at 4:52am
IP IP Logged
Padma
Newbie
Newbie
Avatar

Joined: 09 Sep 2010
Location: India
Online Status: Offline
Posts: 20
Quote Padma Replybullet Posted: 14 Feb 2012 at 7:26am
hi thanks for ur help,
I tried the same formula but it not bring the correct result.
 
in formula field A, B and C, im using different calculation to fetch the data, and finally im applying it in D formula field to bring the final reult.
 
In A in fetchng the current yr quantity
B im fetching previous year quantity
C im fetching the rate
 
and final result D needs to fetch the result in the formula (A-B) * C.
 
when i written this formula it either fetched the value of A or B quantity not the right result.
 
 
priya
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 14 Feb 2012 at 10:54pm

Possibly you are not passing the values between the formulae as you think you are.

It might help if you show us what your formulae are for A, B, C & D

IP IP Logged
Padma
Newbie
Newbie
Avatar

Joined: 09 Sep 2010
Location: India
Online Status: Offline
Posts: 20
Quote Padma Replybullet Posted: 14 Feb 2012 at 11:58pm
Hi,
 
Here are theformulae details:
 
 
formula field A= 
 
if cdate({GZ_QUA_FCST_COMP_REP.SDATE}) in ({?Start Date}) to ({?End Date})
then{GZ_QUA_FCST_COMP_REP.GZ_STAT_HIST_REV_REP_CURR}
 
formula field B=
 
if cdate({GZ_QUA_FCST_COMP_REP.SDATE}) in (({?Start Date})-365 to ({?End Date})-365)
then{GZ_QUA_FCST_COMP_REP.GZ_STAT_HIST_REV_REP_CURR}
 
formula field C=
 
NumberVar x;
if cdate({GZ_QUA_FCST_COMP_REP.SDATE}) in (({?Start Date})-365 to ({?End Date})-365) then
x:= {GZ_QUA_FCST_COMP_REP.GZEXCHANGERATENATUSD}
 
formula field D =
 
NumberVar x;
If {?Currency}=3 and {?Comparison option}=2 then
x := ({A}-{B}) * {C};
 
{?Currency}, {?Comparison option},{?Start Date} and  {?End Date} are parameters.
 
Please help.
Many Thanks,
priya
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