Alteryx Designer Desktop Discussions

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

bytes to kb or mb

jonathangonzales
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?

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus

@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 restart. Order shall return.
Please Subscribe to my youTube channel.
jdunkerley79
ACE Emeritus
ACE Emeritus

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")
jayross017
5 - Atom

So mean.

Labels