Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a table of data like this:
ID | File Size (MB) |
rterweeer | 0.15 |
gfgjfgdf | 55.2 |
eeeeeeree | 800.67 |
dvvfgfhfgfgg | 7500.34 |
rtrtrtrtrtrthtytytyty | 34.3 |
fdfdfd | 45089.45 |
Is there an expresison that converts File Size (MB) into GB?
Imagine a KPI object where it aggregates by Sum([File Size (MB)]).
I want the output of the KPI to be displayed something like:
Where the total size is <1GB then it should display it with MB (e.g. "123 MB" or "760 MB" etc).
And when the total is >1GB then display it with GB (e.g. "15 GB" or "300 GB" etc).
Any idea how to do this?
Hi @jblomqvist
You can try something like this
=num(vMyExpression / if(vMyExpression < 1000,1,1000), if(vMyExpression < 1000, '#.##0 Mb','#.##0,0 Gb'))
Hope it helps
Regards
You may use something like that with 1000 as divisor-basis:
num(sum(FileSize) / pow(10, pick(ceil(len(sum(FileSize))/3), 0, 1, 2, 3) * 3),
'#.##0,0 ' & pick(ceil(len(sum(FileSize))/3), '', 'K', 'M', 'G') & 'Byte')
or a bit adjusted with 1024 as divisor-basis:
= num(sum(FileSize) / pow(1024, pick(ceil(len(sum(FileSize))/3), 0, 1, 2, 3)), '#.##0,0 ' & pick(ceil(len(sum(FileSize))/3), '', 'K', 'M', 'G') & 'Byte')
- Marcus