You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and I want to create a condition if min(temperature_a, temperature_b) < somethreshold OR max(temperature_a, temperature_b) > someOtherThreshold
in SQL I can do something like
SELECT
LEAST(value.temperature_front, value.temperature_back) as min_temp_cells,
GREATEST(value.temperature_front, value.temperature_back) as max_temp_cells,
GREATEST(value.temperature_mosfet, value.temperature_ic) as max_temp_bms
FROM ...
but I don't see the equivalent in PRQL?
The text was updated successfully, but these errors were encountered:
Yes we should probably add these functions. Using s-strings is the best approach for the moment.
For adding them — do we want to use LEAST & GREATEST? I always found these were slightly awkwardly named — they seem to use synonyms for MIN & MAX to to distinguish them from aggregation functions. But the words don't indicate whether they're aggregation functions or not.
We could instead use math.min & math.max given we have the advantage of modules. But possibly that's confusing...
I would probably keep least and greatest for consistency, or perhaps just have an "overload" of min which can be used when there are multiple params, eg min(someField) would be the aggregate of someField over the rows, and min(fieldA, fieldB, fieldC) would be the min of the field for each row (but might be confusing, don't know if there are contexts in which they could have both an "in-row" and "across row" meaning?)
What's up?
I have a table where each row has for example
temperature_a, temperature_b, etc
and I want to create a condition if min(temperature_a, temperature_b) < somethreshold OR max(temperature_a, temperature_b) > someOtherThreshold
in SQL I can do something like
but I don't see the equivalent in PRQL?
The text was updated successfully, but these errors were encountered: