Influxdb 如何使用具有通量的变量访问成员

Influxdb 如何使用具有通量的变量访问成员,influxdb,flux-influxdb,Influxdb,Flux Influxdb,根据,可以使用方括号访问成员。但是,当我尝试使用变量执行此操作时,会导致以下错误 a = "ABC" b = "DEF" //This works calc = (r) => r.ABC - r.DEF calc = (r) => r["ABC"] - r["DEF"] //However, I can't find a way to access the members using the var

根据,可以使用方括号访问成员。但是,当我尝试使用变量执行此操作时,会导致以下错误

a = "ABC"
b = "DEF"

//This works
calc = (r) => r.ABC - r.DEF

calc = (r) => r["ABC"] - r["DEF"]

//However, I can't find a way to access the members using the variables

calc = (r) => r["${a}"] - (r["${b}"]
> type error @8:23-8:36: expected int but found string


calc = (r) => r[a] - r[b]
> type error @8:23-8:31: expected int but found string

如何使用变量访问成员?

抱歉-我引用的同一文档有以下答案:

无法使用任意表达式访问记录的属性