Copying verbatim below from a SE-question:
Trying to make a Influx Continuous Query where certain fields are restricted by a CASE-when. This doesn’t seem to be supported.
Is there a way (i.e.: using joins or something) to get a similar result?
Specifically, this is the query I want to get to work (ohclv based on trade-data):
SELECT min(price) AS low, max(price) AS high, first(price) AS open, last(price) AS close, sum(amount) AS volume, sum(CASE WHEN side="sell" THEN amount ELSE 0 END) AS volume_sell, count(price) AS num_trades, count(CASE WHEN side="sell" THEN 1 ELSE 0 END) AS num_trades_sell FROM db..trades
Alternatively, would the above result be possible with the new Flux-language specification ?