▲ | snthpy 4 days ago | |
Here's a function to normalize values relative to the column range: ```prql let normalize = func x -> ((x - min x)/((max x) - (min x)) | math.round 2) from tracks take 5 derive {ms_norm=(normalize milliseconds), bytes_norm=(normalize bytes)} select {track_id, ms=milliseconds, ms_norm, bytes, bytes_norm} ``` which produces the following SQL: ```sql WITH table_0 AS (
)SELECT track_id,
FROM
table_0-- Generated by PRQL compiler version:0.13.2 (https://prql-lang.org) ``` |