Forum Discussion
Expression:Error: Calculated Column trying to convert to fraction instead of decimal
So i am trying to create a new calculated colum to calculate the true sales price of our products using a calculation, it seems simple enough except i am getting an Expression:Error and i cannot for the life of me work out why? The same calculation is working for half the date and there is no difference other then the numbers being used.
The error im getting is as follows:
Expression:Error: We cannot apply operator / to types Text and Numbers.
Details
Operator=/
Left= 27.48
Right=3
In my eyes this should be 9.16? Does anyone have any idea why this would be throwing an error? My calculations for the column are below: We have 4 wholesalers whos true sale price is calculated slightly differently. Wholesaler 4 is where im getting the error, but wholesaler 3 & 4 are excactly the same other then the wholesaler names?
net_sales_per_unit =
if[Wholesaler Name] = "wholesaler1" then ([api_cost_price] -[claim_amount_per_unit])
else if[Wholesaler Name] = "wholesaler2" then ([net_sales_before_claim] / [quantity])
else if[Wholesaler Name] = "wholesaler3" then ([5iproducts.sell_price_1] - ([claim_amount] / [quantity]))
else if[Wholesaler Name] = "wholesaler4" then ([5iproducts.sell_price_1] - ([claim_amount] / [quantity]))
else 0
Hi lachie-1992
The error is stating that "We cannot apply operator / to types Text and Numbers" so the first thing you can do is check and apply correct data types on your columns that you use for this calculation.
If this does not help, please provide a small data sample + screen prints, including both good records and bad records of base columns and Custom column with the error.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
4 Replies
- Mariusz
Community Champion
Hi lachie-1992
The error is stating that "We cannot apply operator / to types Text and Numbers" so the first thing you can do is check and apply correct data types on your columns that you use for this calculation.
If this does not help, please provide a small data sample + screen prints, including both good records and bad records of base columns and Custom column with the error.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn- lachie-1992Regular Visitor
Thanks Mariusz , I have just changed the three columns to Decimal Number and still the same error. Ive added screen grabs of the data below, as you can
Symbion is Wholesaler3 & Sigma is Wholesaler4 in my code above
- Mariusz
Community Champion
Hi lachie-1992
Any chance you can share a sample file?
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn