Regan,
Thank you for your quick response.   It's absolutely no problem.

Can you help me understand why the design decision was made to drop the
timestamp?  With some aggregations (mean, or count) I could see returning
epoch 0 or the lower bound, but it seems pretty useful to know the first
distinct entry, and as far as I can tell, you don't lose anything by doing
so.

Also, is there any way you can think of to return the timestamp of the
first distinct entry over a time period (I can use this to plot arrival
times guests)

Thanks,
Joshua


*Joshua Clark*
*Cornell Engineering '20Portland, OR | 503-807-2108 |  [email protected]
<[email protected]>*

On Thu, Feb 2, 2017 at 5:54 PM, Regan Kuchan <[email protected]> wrote:

> 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, <[email protected]> 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 [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/ms
>> gid/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 a topic in the
> Google Groups "InfluxData" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/influxdb/iIPT0Lrxgwg/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAKnH5VBxh7ZhomOO8SWQJo%3DXjuC3kOS2gLZFz-%3D%3Dm5-5RB-
> eKQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/influxdb/CAKnH5VBxh7ZhomOO8SWQJo%3DXjuC3kOS2gLZFz-%3D%3Dm5-5RB-eKQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> 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 [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/CAKmZbw9NHLK4vf2ay8O352xsWGQoLfOOofzMokW8szHOHevuQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to