Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Help Post Reply Post New Topic
Author Message
psalm19
Groupie
Groupie
Avatar

Joined: 19 Feb 2009
Online Status: Offline
Posts: 48
Quote psalm19 Replybullet Topic: Formula Help
     Posted: 14 Apr 2010 at 12:15pm
Running CR 10, does the formula below look correct? It basically says...if an ITEM ID matches LABR and the quantity used is less than 1 then the cost of the item to display should be $125 otherwise use this formula to calculate cost, Quantity * SellPrice.
 
If {tblSOPartsUsed.ItemID} = 'LABR' and {tblSOPartsUsed.Quantity} < 1.00 then '$125.00'
else ToText ({tblSOPartsUsed.Quantity} * {tvwr_PriceBook.SellPrice})
 
If I place it in GH tblSOPartsUsed.SOPartsUsedKeyID all parts show a $1 cost. Not sure where I took a wrong turn, help please.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Apr 2010 at 2:29pm
in general it looks correct but keep in mind it is only evaluating all of these fields as they relate to one row of data only. By placing the field on a GH it will only display the result of the formula for the first row of data in the group. Place another copy ofthe formual field in the details and you will see that the first detail row of each group is the value you get for the group header.
Does this help?
IP IP Logged
psalm19
Groupie
Groupie
Avatar

Joined: 19 Feb 2009
Online Status: Offline
Posts: 48
Quote psalm19 Replybullet Posted: 20 Apr 2010 at 11:47am
DBlank as always, I appreciate your help! I think I found a solution to the problem, below is the formula I used and so far it seems to be working okay.
 
If {tblSOPartsUsed.Quantity} < 1.00 then {tvwr_PriceBook.SellPrice} else
{tblSOPartsUsed.Quantity} * {tvwr_PriceBook.SellPrice}
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