Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pskumars
Partner - Contributor III
Partner - Contributor III

MB -GB - TB conversion into GB

HI All

i have below field with different types..like MB,GB & TB in string format.. need to calculate in GB only(only numeric no need of type)..

Space

2.0 TB
79.3 GB
2.0 TB
28.2 GB
2369.8MB
257.7 GB
62.9 GB
114.2 GB
108.1 GB
9.0 GB
62.8 GB
3 Replies
Anil_Babu_Samineni

You can calculate like

If(Right(Space,2) = 'TB', Space / 1024 , Space) as Space

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
avinashelite

Try like this


if(subfiled(Space,'' ,2))='TB',subfiled(Space,'' ,1))*1024,subfiled(Space,'' ,1))) as Space

effinty2112
Master
Master

Hi Surendra,

Maybe:

Space GB
2.0 TB2048.00
9.0 GB9.00
28.2 GB28.20
62.8 GB62.80
62.9 GB62.90
79.3 GB79.30
108.1 GB108.10
114.2 GB114.20
257.7 GB257.70
2369.8MB2.31

GB = PurgeChar(Space,'BMGT')*Pick(Match(Keepchar(Space,'MGT'),'M','G','T'), 1/1024,1,1024)

Kind regards

Andrew