Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

bytes to kb or mb

Highlighted
8 - Asteroid

Im using the directory tool and the size column only shows in bytes. Anyone know how to convert to kb, mb, or gb?

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@jonathangonzales,

 

Please have a sense of humor :)

 

http://lmgtfy.com/?q=convert+bytes+to+kb

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
16 - Nebula
16 - Nebula

Without looking at @MarqueeCrew solution...

 

I'd do the following 2 step formula

- Work out the base:

MIN(5,FLOOR(LOG10([Size])/LOG10(1024)))

- Make it pretty:

trim(tostring([Size]/POW(1024, tonumber([SizeNice])),3),".0") + SWITCH(tonumber([SizeNice]), " B", 1, " kB", 2, " MB", 3, " GB", 4, " TB", 5, " PB")
Highlighted
5 - Atom

So mean.

Labels