on 02-11-2010 2:39 AM
Hello
We have a field LENGTH coming from SAP which can be in INCHES or FEET,
The need is to convert LENGTH to Centimeters.
I have created a calculated field,"LENGTH(Metric)" which converts INCHES to CMS,but LENGTH can be in FEET too.
How do I write this expression in the calculated field?
I do not want to create assignments but use the calculated fields
Thanks
Kalyan
Hi Kalyan,
do you have the uom in the same field?
Otherwise you could use something like that:
if(<uom field>="inches",<length>/2.54,<length>/30.48)
This tests whether the UOM field is "inch" and then divides the Length field by the factor 2.54, otherwise it divides by 30.48 (assuming it is "foot").
Hope that helps.
Best regards
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian
Thanks for that idea..I think it works..
For others searching the forum here is my code:
If(RIGHT(LENGTH,2)="in",MID(LENGTH,1,LEN(LENGTH)-2)*2.54 cms
Check the rightmost 2 characters of the LENGTH column is inches
ELSE
MID(LENGTH,1,LEN(LENGTH)-2)*30.4 cms)
multiplying by the factor after leaving out the UOM by using MID
Thanks
Kalyan
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.