Hello, I am getting very strange result without using drop in flux for particular string.
- When the DROP is not applied (1.case) to msgid field, looks like there is no calculation for SUM. Why do I need to drop msgid field in order to get the sum result (2.case)?
- Even when not apply DROP (1.case) and use SUM function for _value field, why the SUM is not calculated ? I am pointing sum up _value fields which are numbers so just calculate those or ?
Thanks for helping out to understand
1. case: Not applying DROP (no SUM result)
from(bucket: "test")
|> range(start: -15m)
|> filter(fn: (r) =>
r._measurement == "quantity" and
r._field == "countfld")
|> sum(column: "_value")
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string,string,string,long
#group,false,false,true,true,true,true,true,true,true,true,true,true,false
#default,_result,,,,,,,,,,,,
,result,table,_start,_stop,_field,_measurement,deviceid,green,msgid,red,trigger,yellow,_value
,,0,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,265,0,cycle,0,1
,,1,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,266,0,cycle,0,1
,,2,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,267,0,cycle,0,1
,,3,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,268,0,cycle,0,1
,,4,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,269,0,cycle,0,1
,,5,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,270,0,cycle,0,1
,,6,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,271,0,cycle,0,1
,,7,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,272,0,cycle,0,1
,,8,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,273,0,cycle,0,1
,,9,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,274,0,cycle,0,1
,,10,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,275,0,reject,0,1
,,11,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,276,0,cycle,0,1
,,12,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,277,0,cycle,0,1
,,13,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,278,0,cycle,0,1
,,14,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,279,0,cycle,0,1
,,15,2020-01-17T12:53:00.29679007Z,2020-01-17T13:08:00.29679007Z,countfld,quantity,test12,0,280,0,cycle,0,1
2. case: Applying DROP (sum is OK)
from(bucket: "test")
|> range(start: -15m)
|> filter(fn: (r) =>
r._measurement == "quantity" and
r._field == "countfld")
|> drop(columns: ["msgid"])
|> sum(column: "_value")
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string,string,long
#group,false,false,true,true,true,true,true,true,true,true,true,false
#default,_result,,,,,,,,,,,
,result,table,_start,_stop,_field,_measurement,deviceid,green,red,trigger,yellow,_value
,,0,2020-01-17T12:57:00.699043677Z,2020-01-17T13:12:00.699043677Z,countfld,quantity,test12,0,0,cycle,0,15
,,1,2020-01-17T12:57:00.699043677Z,2020-01-17T13:12:00.699043677Z,countfld,quantity,test12,0,0,reject,0,1