Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
C1109
Contributor III
Contributor III

Convert file sizes - bytes kilobytes megabytes terabytes

Hi all, 

I'm fairly new to Qlik and struggling with an issue I hope someone can help with...

I have a spreadsheet loading into Qlik containing file sizes in Megabytes. If possible I would like Qlik to automatically select the most appropriate units in a visualisation when multiple rows are selected.

Have tried using manual calculations based on other threads I've found but these are very confusing. Surely Qlik is smart enough to do the work for us in this sense?

Labels (1)
1 Reply
EnriqueMartinez
Contributor II
Contributor II

This method works for me:

Dual(
        If(size_bytes >= Pow(1024,4), Num(size_bytes / Pow(1024,4), '#,##0.00') & ' TB',
        If(size_bytes >= Pow(1024,3), Num(size_bytes / Pow(1024,3), '#,##0.00') & ' GB',
        If(size_bytes >= Pow(1024,2), Num(size_bytes / Pow(1024,2), '#,##0.00') & ' MB',
        If(size_bytes >= 1024, Num(size_bytes / 1024, '#,##0.00') & ' KB',
        Num(size_bytes,'#,##0') & ' Bytes')))),
        size_bytes)
        As human_readable_size,

 

Technologist for Library Services | Delivering Advanced Discovery Solutions, ILS Integrations & Data Analytics