Hello,

Thank you for the answer. CQ works perfectly. I am using 0.13 version for 
your information, I forgot to specify in my first message. 

If I understood your explanation, I cannot do the follow:

I have a database with just one measurement. For this measurement , I have 
just one field with the field key = value. But I have a lot of different 
tag keys. I wanted to do some operations between two series with 2 
different tags value, but the same field. for example a series with one tag 
minus a series with an other tag for the same measurement and the same 
field.

I cannot do that without using  CQ or Kapacitor? Is it correct? Is it 
scheduled to add this feature in a future version?

Thank you

wug

Le mercredi 24 août 2016 17:10:08 UTC+2, Sean Beckett a écrit :
>
> Since you have two mutually exclusive WHERE clauses, you cannot accomplish 
> your goal with one query. InfluxDB does not yet support a HAVING clause or 
> subqueries.
>
> However, this should be doable with continuous queries, unless I'm missing 
> something.
>
> CREATE CQ...
>   select 4*mean("value") AS mean_real INTO "puissance.electricite" from 
> "puissance.electricite" where station =~ /fmv.hydro.*/ and "typeof" = 
> 'real' group by time(15m)
> END
>
> CREATE CQ...
>   select sum("value") AS sum_forecast INTO "puissance.electricite"  from 
> "puissance.electricite" where station =~ /fmv.hydro.*/ and "typeof" = 
> 'forecast' group by time(15m)
> END
>
> Then for your difference query:
>
> SELECT mean_real - sum_forecast FROM "puissance.electricite" WHERE time > 
> now() - 2w  group by time(15m)
>
>
> On Wed, Aug 24, 2016 at 5:48 AM, wug <[email protected] <javascript:>> 
> wrote:
>
>> Hello,
>>
>> I am completely new with InfluxDB. I have a database with one measurement 
>>  which has a tag key = station with 4 tag values and a tag key = typeof 
>> with two tag values: real and forecast.  I have values with a period of 1 
>> minute for the tag value real and values with a period of 15 minute for the 
>> tag value forecast.
>>
>> The goal is:
>> - First to get series which is the sum on the 4 stations of the values at 
>> one timestamp. 
>> - Then for the tag value real do the average on 15 minutes to get 15 
>> minutes values. 
>> - Finally do the difference between tag with real and tag with forecast. 
>>
>> Can I do this in one query? If not what is the way to perform that in 
>> InfluxDB.
>>
>>
>> I did the first 2 steps like that:
>>
>> for the real tag:
>>
>> select 4*mean("value") from "puissance.electricite" where station =~ 
>> /fmv.hydro.*/ and "typeof" = 'real' and time < now() and time > now() - 2w  
>> group by  time(15m)
>>
>>               
>>
>> for the forecast tag:
>>
>> select sum("value") from "puissance.electricite" where station =~ 
>> /fmv.hydro.*/ and "typeof" = 'forecast' and time < now() and time > now() - 
>> 2w  group by  time(15m)
>>
>>
>>
>> And I want to do the difference of this 2 queries.
>>
>>
>> I know that kapacitor or continues queries can do these kind of things. I 
>> tried without success.
>>
>>
>>
>> Thank you for your help,
>>
>>
>> wug
>>
>>
>>
>> -- 
>> Remember to include the InfluxDB version number with all issue reports
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "InfluxDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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/d3649745-e6f0-4c77-a4c9-8732bbc2e492%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/influxdb/d3649745-e6f0-4c77-a4c9-8732bbc2e492%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Sean Beckett
> Director of Support and Professional Services
> InfluxDB
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" 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/884940cc-0a61-4955-bf0b-7090faacf965%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to