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.
time < now() is probably not needed as the continuous query automatically filters to the window of (now(), now() - group_by_interval].
Otherwise, I suggest breaking down your query to see if the individual parts are returning the results you expect.
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).
Please take a look at this issue:
If you are using 2.x you have a lot of options when it comes to manipulating timestamps:
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?
You increased the queue length to 100? https://docs.influxdata.com/influxdb/v2.0/reference/config-options/#query-queue-size
If you’re at 100, it seems like you’re still running more queries than that at once. Can you spread them out?
Hi @philjb @Anaisdg. I have created a task from influxdb ui, where that task is stored inside influxdb container in docker. U have any idea?
@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.
@Anaisdg @philjb i have a posted a question maybe u could help me.
link - Filtering data using tagpass and tagdrop