Hi Joshua,

Thank you for pointing this out. The sentence "The timestamp reflects the
first time the field value appears in the data" is from a previous version
and shouldn't be in the documentation. In version 1.2, DISTINCT() returns
epoch 0 unless you specify a lower bound on the time range. We're actually
in the midst of reworking the entire functions page so I've added that to
the GitHub issue
<https://github.com/influxdata/docs.influxdata.com/issues/757>.

Again, thanks for letting us know. Apologies for the confusion - we promise
to get that fixed and improve that page!

Regan



On Thu, Feb 2, 2017 at 3:47 PM, <j...@clarkpdx.com> wrote:

> 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 influxdb+unsubscr...@googlegroups.com.
> To post to this group, send email to influxdb@googlegroups.com.
> 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.
>

-- 
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 influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
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/CAKnH5VBxh7ZhomOO8SWQJo%3DXjuC3kOS2gLZFz-%3D%3Dm5-5RB-eKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to