Hello,
I'm using Influx to keep track of customer pass usage at a resort. Every time
a customer scans their pass at a gate, I add their customer ID, pass type, and
time to the db.
I want to know the first time a unique customer scans in a 24h period (i.e. if
that customer showed up that day), which will let me plot arrival times of each
customer. The distinct function appeared perfect for this. The documentation
gives this example:
Select the unique field values in the level description field:
> SELECT DISTINCT("level description") FROM "h2o_feet"
name: h2o_feet
--------------
time distinct
1970-01-01T00:00:00Z between 6 and 9 feet
1970-01-01T00:00:00Z below 3 feet
1970-01-01T00:00:00Z between 3 and 6 feet
1970-01-01T00:00:00Z at or greater than 9 feet
The response shows that level description has four distinct field values. The
timestamp reflects the first time the field value appears in the data.
If the timestamp indeed reflected the first time the field value appeared in
the data, I would be set. However, on the very next line, the documentation
notes this:
Note: Aggregation functions return epoch 0 (1970-01-01T00:00:00Z) as the
timestamp unless you specify a lower bound on the time range. Then they return
the lower bound as the timestamp.
This appears to state the exact opposite. The queries I've written all return
epoch 0 as the timestamp. I was wondering if this is just a mistake in the
documentation, or if there is some way to have DISTINCT (or some other
function?) return the timestamp of the first distinct record in some time range.
Thanks for helping me understand the distinct function,
Joshua
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit
https://groups.google.com/d/msgid/influxdb/29157cb1-ca39-4b22-ab99-b20a2d58800a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.