0
votes

I am trying to sum two different formula fields in Crystal. It will not let me select them from the Sum. The first formula is

if Sum ({tblPostedLine.pli_QUANTITY_SHIPPED}) >= 1 
then {tblPostedLine.pli_NET_PRICE}
else ({tblPostedLine.pli_NET_PRICE} * -1)

I am trying to take a price and make it a negative value if the quantity is a negative value. I then want to sum the amounts to get a net amount that was shipped.

The other formula is

If PreviousIsNull({RodsvwCatalogAnalysis.pro_PROMOTION_CODE}) 
or ({RodsvwCatalogAnalysis.pro_PROMOTION_CODE}) <> 
Previous({RodsvwCatalogAnalysis.pro_PROMOTION_CODE}) 
then {RodsvwCatalogAnalysis.pit_AREA_PER_PAGE} else 0

With this formula, I am trying to sum at a group level, not the details level. When I just sum the group level number, it is adding it every time the value is listed in the details as well.

I am open to any suggestions. Thanks!

1

1 Answers

1
votes

For the first scenario, Create 1 variable formula in detail level to hold with your requirement. for e.g.

    @NetPrice , formula if {tblPostedLine.pli_QUANTITY_SHIPPED} >= 1 then 
{tblPostedLine.pli_NET_PRICE} else ({tblPostedLine.pli_NET_PRICE} * -1)

using running total field feature in your Field Explorer to sum up the value and place your group footer.

For the second scenario, I believe it relate to promotion group and again you could use the running total field feature to evaluate the sum condition and reset the value when condition are meet like field value change.