I wanted to run a query whose SQL format is available to me:
“select round(avg (((PUCCHNack + PUSCHNack) / (PUCCHNack+PUCCHAck + PUSCHNack+PUSCHAck)) * 100),2)”.
I converted the above SQL query to influxql format for which I was getting error - expected field arguments in mean():
“select round(mean(ans)) into baghel_kpi from (select sum_value1/sum_value*100 as ans from (select PUCCHNack+PUCCHAck+PUSCHNack+PUSCHAck as sum_value, PUCCHNack+PUSCHNack as sum_value1 from cu_om where time < now())) group by time(1h)”
so I referred some documentation and changed some thing:
"select mean(ans) from (select sum_value1/sum_value*100 as ans from (select PUCCHNack+PUCCHAck+PUSCHNack+PUSCHAck as sum_value, PUCCHNack+PUSCHNack as sum_value1 from cu_om))where time < now() group by time(1h) "
The problem occurring here is for some timestamp i am not getting the mean value even if for that timestamp all field keys are present. In the figure for the timestamp for which no result is coming in that timestamp also the data is present. So i am not sure what is wrong in my query.
Thank you, you suggestion worked to break down the query. I am facing one doubt could you help me to solve it - Suppose i wanted to group the data for 8:00 - 9:00 am using group by time(1h). So the value is coming under 8:00 timestamp, i wanted to put the same result in 9:00 timestamp. Is there any way to do that, i tried with offset i.e. group by time(1h,1h). The results are coming same as that of group by time(1h).
Hi @Anaisdg@philjb. Actually i am running some 40 - 41 task all at same time, so some of them are showing queue length exceeded error. I tried with retry option for task, also i changed in influx config file - the query size and query concurrency. Set both to 100. Still error is showing. You have any solution for that? Will running some kpis some seconds later will work fine?
@Pratik_Das_Baghel - could you start a new thread? Your question doesn’t seem related to your original question. I don’t fully understand your question either so please add more detail. You can also ask in the Influxdata community slack.