Modifying query elements with separate multipliers

  • What Grafana version and what operating system are you using?

  • What are you trying to achieve?

The query language for the price only (given in the InfluxDB interface) works well, but I don’t know how to modify this to include the multipliers and plot only those results (not the original prices).

  • How are you trying to achieve it?

I want to modify this code to include the multipliers:

‘’’
from(bucket: “alpha”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “alphavantage”)
|> filter(fn: (r) => r[“_field”] == “A” or r[“_field”] == “B” or r[“_field”] == “C” or r[“_field”] == “D”)
|> filter(fn: (r) => r[“host”] == “Franklin”)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “last”)


* What happened?

The code above correctly graphs the prices.

* What did you **expect** to happen?

* Can you copy/paste the configuration(s) that you are having problems with?

* Did you receive any errors in the Grafana UI or in related logs? If so, please tell us **exactly** what they were.

* Did you follow any online instructions? If so, what is the URL?

I used a stock market price API to get prices via telegraf. I wanted to multiply those numbers by the actual shares I held, and plot the actual holdings in dollars as a time series. I could easily get the share prices as a time series but could not multiply by my share holdings. I finally gave up on Grafana, and eventually figured out how to do the multiplication with telegraf. Multiplying two numbers is difficult in either case.