Closed SwathiMuppalla closed 5 years ago
Need to change panel data source to Meta queries and the do A['metric_name']-B['metric_name']
Also if I think you will have to change your query to print values for each version and then do it
Hi, @Gauravshah Thanks for the response..I am using Elasticsearch and Grafana 6.2.5 version.
I did print values for two versions and used B['Count']-A['Count']. I get NAN.
The query I used in elastic search
A = version.keyword:"ABC"
B = version.keyword:"XYZ"
I am using table panel showing aggregation Total.
I believe you should use the expressions as B['B'] - A['A']. When using an elasticsearch datasource, you should use the query alias to form the expression (or you could change the aliases).
@Rasinhas Thank you so much. It's working. In the same way, I am trying to get the division B['B']/A['A']- It is not working. Could you help me out with the expression for the division?
Thanks
What is happening with the division? Is it showing NaN as well?
It should be working with B['B']/A['A']
@Rasinhas Yes, it is showing NAN. (B['B'] - A['A']) /100 = gives me value. (B['B] / 624) = works good. But B['B']/A['A'] = shows NAN
https://github.com/GoshPosh/grafana-meta-queries/issues/16 As per this comment https://github.com/GoshPosh/grafana-meta-queries/issues/16#issuecomment-422425695 I used A['A'] ? B['B']/A['A'] : 0
It works but shows wrong value.
I don't even know if Metaqueries supports ternary operations.
About the NaN, what is the table transform you are using? "Time series aggregations"? When you look at the table using the "Time series to columns" transform, does the data show correctly? For me it sometimes show NaN for the current interval, as the value of A is 0 when a new interval just starts. I believe the problem is that for "Time series aggregations" grafana simply sums the value of the metrics for each interval, and since NaN + integer = NaN, you will always get Value = NaN on the final table.
Yeah, I am using Time series aggregations
. It's not working for Time series to columns
too. As you said for Time series aggregations
. Whenever a new interval starts the Value of A and B is 0.
instead of interval auto try interval month to see if that answers, I think the issue is that aggregation behaves differently in meta queries vs elastic
@Gauravshah Hi Gaurav. Thanks for the suggestion. It works well when I give interval = 10000d
Need to change panel data source to Meta queries and the do A['metric_name']-B['metric_name']
Also if I think you will have to change your query to print values for each version and then do it
Hi @Gauravshah, @Rasinhas Instead of printing the values of each version. Is there any way I could get every version dynamically in each query? Thanks
@SwathiMuppalla Group by support needs to be completed https://github.com/GoshPosh/grafana-meta-queries/pull/63
Thanks @Gauravshah
@Gauravshah I have been using table plugin in grafana 6.2.5, Elasticsearch datasource. I have a situation where i have a template variable “Version” with data V1, V2, V3 …etc. for every version there is lots of data and i am querying to get total count of every versions data eg: V1 Total V2 Total A 10 A 20 B 20 B 15 C 30 C 25 Since I am having template variable “Version” If i try combining two versions i get V1,V2 | Total A | 30 B | 35 C | 55
But I am trying to create another column in table panel to subtract the values which i am not able to create. I need it like this V1,V2 | Total | Difference A | 30 | 10 B | 35 | 5 C | 55 | 5
I need Difference column which gives value of (server1 - server3) How do i do this using metaqueries?