Reporting and Prediction

Hello Team,

I need to create a report on looker where the data is as follows

Max size(Peta) Size used Timestamp(MM/DD/YY)

2 Petabytes 600 TB 9/1/2016 2:15:06

2 Petabytes 900 TB 9/1/2016 5:15:06

2 Petabytes 1001 TB 7/1/2016 5:15:06

2 Petabytes 1400 TB 7/1/2016 7:15:06

2 Petabytes 1800 TB 5/1/2016 2:15:06

2 Petabytes 1900 TB 5/1/2016 4:15:06

I need to have the daily max value of space taken based on time stamp field for each day and create a report.

The x axis should be date and y axis the latest space utilization on that.

2 replies

Userlevel 3

Hey @sudeep,

In this case it seems that the data for “size used” is of format string so we would want to have it in an integer format.

Depending on your SQL language you can use trim() or substring() functions on the database field to keep only the numerical value and cast it as an integer in your measure.

And wrapping this in a measure of type: max

For example in Postgres you could use:

measure: measure_name { type: max sql: CAST(trim(trailing ' TB' from ${TABLE}.size_used) AS INTEGER) }

That way in the Explore, you will be able to retrieve the max value for each day.

Thanks a lot Romain. I will try to work based on the guidelines provided.