Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Partner
Partner

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

Re: MB -GB - TB conversion into GB

You can calculate like

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

Re: MB -GB - TB conversion into GB

Try like this


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

effinty2112
Honored Contributor

Re: MB -GB - TB conversion into GB

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