Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula using variables Post Reply Post New Topic
Author Message
CAWA
Newbie
Newbie


Joined: 16 Jun 2009
Location: Australia
Online Status: Offline
Posts: 7
Quote CAWA Replybullet Topic: Formula using variables
    Posted: 05 Jul 2009 at 4:58pm
I have the following :
-------------------------------------------------
GH1 - {Client}
GH2 - {Batch No}
GH3 - {Sample No}
GH4 - {Test}
      {TestName} (eg Weight)
             Detail a  {Value}  
 
GF4
GH4
      {TestName}    (eg Area)
          Detail a   {Value}
GF4
GH4
       {TestName}   (eg Conc)   
           Detail a    {Value}
 
GF4
GF3  
GF2
GF1
------------------------------------------------------------
I need to calculate, per Sample No (GF3),  the (Weight * Area)/Conc
I am not well versed in the use of variables and this would probably be the way to do it.
After making that calculation I need to use the results to average over the Batch No then the Client etc.
I am using Crystal vs 9
Thanks for any assistance
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 06 Jul 2009 at 6:09am
gh3:
shared numbervar weight:=0;
shared numbervar conc:=0;
shared numbervar area:=0;
 
detail a
shared numbervar weight;
shared numbervar conc;
shared numbervar area;
if {Testname} = "Weight" then
 weight := weight + {Value};
...
 
gf3
shared numbervar weight;
shared numbervar conc;
shared numbervar area;
(weight*area)/conc
 
should do it, not too bad/hard.
 
HTH
 
IP IP Logged
CAWA
Newbie
Newbie


Joined: 16 Jun 2009
Location: Australia
Online Status: Offline
Posts: 7
Quote CAWA Replybullet Posted: 06 Jul 2009 at 4:03pm

Thanks for that.  It is my first attempt at using variables - so I should be able to build and learn from this

Thanks again.
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.