Click to See Complete Forum and Search --> : calculate a price based on a category


ekr
June 27th, 2008, 03:24 PM
Hello-

My dataset has 500 items, each with a unique price. Each of these items is associated with one of 5 categories. Based on the category, I want my report to calculate a new price.

For example, if the category is A, multiply the price column by 10.

If the category is B, multiply price column by 20. and so on...

I this possible in Crystal and if so, how do I do it? I am not very savvy with the formula fields, but I am very determined to solve this. Any help you can provide would be helpful! Thanks in advance.

E. Rice

Ned Pepper
June 27th, 2008, 04:11 PM
An example formula would be
select {TABLE.category}
case A : {TABLE.Price} * 10
case B : {TABLE.Price} * 20
case C : {TABLE.Price} * 30
case D : {TABLE.Price} * 40
case E : {TABLE.Price} * 50
default : {TABLE.Price}

ekr
June 30th, 2008, 04:14 PM
Thanks for the help. I am getting some error messages that I can't seem to blast through:

"A number or currency amount is required here." (in front of {details.List Price} ) OR
"The remaining text does not appear to be part of the formula."

If I put a number there, it multiplies it x 10 vs. pulling the price from the field.

Here is my formula- where does it need to be corrected?

select {price category.Field1}
case "General":{details.List Price}*10
case "Mixed": {details.List Price}*20
case "Metal Only": {details.List Price}*30
case "Purchased": {details.List Price}*40
default:{details.List Price}

jggtz
June 30th, 2008, 10:44 PM
Probably {details.List Price} isn't numeric