Member-only story

TL;DR Tech Tips — Add Temporary Data with Flux

Anais Dotis
2 min readJul 20, 2020

--

In this post, we share a way to generate a table with Flux.

Q: I want to perform a task that executes a join() but I don’t always have data for one of the input tables. How can I create an initial or default state for that one input table?
A: Generate temporary data with Flux.

Generating temporary data with Flux

1. Navigate to the Data Explorer tab. Use the query builder to return data that’s in a similar shape to the new table you want to generate. Click the CSV download icon. This will download an Annotated CSV. This approach is recommended because manually creating an Annotated CSV can be frustrating. In this example, I have data about the number of cats and dogs in a shelter. I want to add a table with data about bunnies.

2. Open the Annotated CSV and copy the headers as well as the first line.

#group,false,false,true,true,false,false,true,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
#default,_result,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,shelter,type
,,0,2020-05-01T15:06:27Z,2020-07-09T15:06:27.516Z,2020-05-15T18:50:33.262484Z,3,young,cats,B,calico

--

--

Anais Dotis
Anais Dotis

Written by Anais Dotis

Developer Advocate at InfluxData

No responses yet