Topic: Help with Formulas - summation Posted: 14 Apr 2014 at 6:44am
I have 2 formula's in my crystal report. One of them decides what gifttype to use and the other decides if they are part of a certain group with a yes or no. If I just have output id and Formula 1 then my gift calculations are correct.
If I just have id and formula 2 then my formula 2 yes and no's are correct.
If I try to use both formula's then formula 2 yes and no's are correct but formula 1 gift calculations are multiplied by the total amount of attrtypes the id has associated with them, even if they are not one of the selected yes's.
Formula 1 (which is summed)
If {GIFT_TYPES.TABLE_CODE} = "g" then {GIFTS_FULL.GIFTAMOUNT}
else if {GIFT_TYPES.TABLE_CODE} = "c" then {GIFTS_FULL.GIFTAMOUNT}
else if {GIFT_TYPES.TABLE_CODE} = "p" then {GIFTS_FULL.GIFTAMTPLG}
else if {GIFT_TYPES.TABLE_CODE} = "e" then {GIFTS_FULL.GIFTAMTPLG}
else if {GIFT_TYPES.TABLE_CODE} = "r" then {GIFTS_FULL.GIFTAMTPLG}
else 0
Formula 2:
If ({attribute_full.attrtype} = "LSVT" or {attribute_full.attrtype} = "BVC" or {attribute_full.attrtype} = "SVC"
or {attribute_full.attrtype} = "EVC" or {attribute_full.attrtype} = "ENVC" or {attribute_full.attrtype} = "AVC"
or {attribute_full.attrtype} = "ASVC" or {attribute_full.attrtype} = "SVC" or {attribute_full.attrtype} = "UVC"
or {attribute_full.attrtype} = "VCCE" or {attribute_full.attrtype} = "BOT" or {attribute_full.attrtype} = "FBoD"
) then 'Y' else 'N'
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 14 Apr 2014 at 6:57am
Likely has to do with your joins and when crystal enforces them.
you will see the same thing happen just by using any field from all the tables in your data set or if you go into the jouins and set them all to 'enforced'.
Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Posted: 28 Apr 2014 at 8:37am
DBlank didn't mean that enforcing the joins would fix the issue, rather that it would reveal that the joins are the source of the problem. You need to look at how your tables are joined to each other to fix the problem. Are you sure you have the correct fields joined to each other? If so, try changing the join type to see if the problem resolves itself.
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