Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Using the results of a formula in another formula Post Reply Post New Topic
Author Message
jabucket
Newbie
Newbie


Joined: 15 Nov 2011
Location: United States
Online Status: Offline
Posts: 7
Quote jabucket Replybullet Topic: Using the results of a formula in another formula
     Posted: 28 Nov 2011 at 8:29am
I have a formula that calculates cost per unit depending on the code of a certain item:
 
if {vwProdAnalysis.Procedure_Code} = "J2505" then "2665.04"
else if {vwProdAnalysis.Procedure_Code} = "J9035" then "56.36"
else if {vwProdAnalysis.Procedure_Code} = "J9355" then "68.81"
else if {vwProdAnalysis.Procedure_Code} = "J9171" then "4.28"
else if {vwProdAnalysis.Procedure_Code} = "J9310" then "594.37"
else if {vwProdAnalysis.Procedure_Code} = "J9263" then "4.03"
else if {vwProdAnalysis.Procedure_Code} = "J2469" then "15.23"
 and so on...
 
The formula works great, but I need to multiply the value returned from that formula against another value in the report (units). The formula I tried initially is:
 
Sum ({vwProdAnalysis.Units}, {@Location}) * {@CostUnit}
 
but it requires a number, etc.
 
Any ideas?
 
Thanks
 
Jeff
IP IP Logged
jabucket
Newbie
Newbie


Joined: 15 Nov 2011
Location: United States
Online Status: Offline
Posts: 7
Quote jabucket Replybullet Posted: 28 Nov 2011 at 10:09am
I got around this by removing the quotes from the numeric value and turning it into a number instead of a string.
 
This presented another problem though. I cannot insert a summary off of this forumla. Anyone know why?
 
Jeff
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Nov 2011 at 10:14am
You cannot sum a SUM
the sum of another formula that multiplies the values should give you the same result
(unless you have rounding rules in palce)
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