on 06-26-2015 3:40 PM
Hi all,
I try to create a formula name COMMN to calculate the commission sale based on each car sells as following:
-----------------------------------------------------------------------------------------------------------------------------------------------------------
IF ISNULL({CarModel})
THEN
(
IF {CarMake} = 'BMW' And {Condition} = 'Excellent'
THEN(ToNumber({GrossSale}) - ToNumber({ServiceFee})) * 0.50
ELSE IF {ReportGSRCSpecialSurplusDataT{CarMake} = 'BMW' And {Condition} = 'Good'
THEN (ToNumber({GrossSale}) - ToNumber({ServiceFee})) * 0.30
ELSE 0.00
)
ELSE //car models such 740, 535, 315, Z3, Z4, etc...
IF MID({CarModel, 1, 1) = '7'
THEN (ToNumber({GrossSale}) - ToNumber({ServiceFee})) * 0.25
ELSE IF MID({CarModel, 1, 1) = '5' OR MID({CarModel, 1, 1) = '3'
THEN (ToNumber({GrossSale}) - ToNumber({ServiceFee})) * 0.15
ELSE IF MID({CarModel, 1, 1) = 'Z'
THEN (ToNumber({GrossSale}) - ToNumber({ServiceFee})) * 0.10
----------------------------------------------------------------------------------------------------------------------------------------------------------------
and put A in the detail section. When I run the report I can see other column data but nothing in COMMN. Is it something wrong in above codes even no syntax error when create it. Any help is much appreciated. Thanks in advance.
I would try changing the first line to something like this:
IF ISNULL({CarModel}) or {CarModel} <= 0
Also, instead of using "Mid" to get the first letter of the model, try using Left({CarModel}, 1).
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.