Hi,
I have following data (below) in Influxdb 2.0 and want to find multiple lines where column requestdate is the latest. There might be two approaches
-
Should be simmilar to |> last(column: “requestdate”) but to return multiple records when there are multiple columns with latest requestdate.
-
Other option would be to group tables by requestdate but I can’ find how to keep only table with latest requestdate
#group,false,false,true,false,false,false,true
#datatype,string,long,string,dateTime:RFC3339,double,long,string
#default,mean,
,result,table,_field,_time,_value,requestdate,s2_cell_id
,0,feels_daytemp,2021-01-31T10:00:00Z,-9.67,1612085402,46ddc
,0,feels_daytemp,2021-02-01T10:00:00Z,-11.24,1612085402,46ddc
,0,feels_daytemp,2021-02-02T10:00:00Z,-11.92,1612085402,46ddc
,0,feels_daytemp,2021-02-03T10:00:00Z,-8.41,1612085402,46ddc
,0,feels_daytemp,2021-02-04T10:00:00Z,-11.39,1612085402,46ddc
,0,feels_daytemp,2021-02-05T10:00:00Z,-16.77,1612085402,46ddc
,0,feels_daytemp,2021-02-01T10:00:00Z,-11.24,1612083602,46ddc
,0,feels_daytemp,2021-02-02T10:00:00Z,-11.92,1612083602,46ddc
,0,feels_daytemp,2021-02-03T10:00:00Z,-8.41,1612083602,46ddc
,0,feels_daytemp,2021-02-04T10:00:00Z,-11.39,1612083602,46ddc
,0,feels_daytemp,2021-01-31T10:00:00Z,-9.81,1612083602,46ddc
,0,feels_daytemp,2021-02-05T10:00:00Z,-16.77,1612083602,46ddc
,0,feels_daytemp,2021-02-04T10:00:00Z,-11.39,1612081802,46ddc
,0,feels_daytemp,2021-02-03T10:00:00Z,-8.41,1612081802,46ddc
,0,feels_daytemp,2021-02-02T10:00:00Z,-11.92,1612081802,46ddc
,0,feels_daytemp,2021-02-01T10:00:00Z,-11.24,1612081802,46ddc
,0,feels_daytemp,2021-01-31T10:00:00Z,-9.62,1612081802,46ddc
,0,feels_daytemp,2021-02-05T10:00:00Z,-16.77,1612081802,46ddc
,0,feels_daytemp,2021-01-31T10:00:00Z,-9.67,1612081086,46ddc
,0,feels_daytemp,2021-02-01T10:00:00Z,-11.24,1612081086,46ddc
,0,feels_daytemp,2021-02-02T10:00:00Z,-11.92,1612081086,46ddc
,0,feels_daytemp,2021-02-03T10:00:00Z,-8.41,1612081086,46ddc
,0,feels_daytemp,2021-02-04T10:00:00Z,-11.39,1612081086,46ddc
,0,feels_daytemp,2021-02-05T10:00:00Z,-16.77,1612081086,46ddc
Expected result would be:
,0,feels_daytemp,2021-01-31T10:00:00Z,-9.67,1612085402,46ddc
,0,feels_daytemp,2021-02-01T10:00:00Z,-11.24,1612085402,46ddc
,0,feels_daytemp,2021-02-02T10:00:00Z,-11.92,1612085402,46ddc
,0,feels_daytemp,2021-02-03T10:00:00Z,-8.41,1612085402,46ddc
,0,feels_daytemp,2021-02-04T10:00:00Z,-11.39,1612085402,46ddc
,0,feels_daytemp,2021-02-05T10:00:00Z,-16.77,1612085402,46ddc