How to create dynamic query in influx db

str2’= '“qam4Strong” or r[“_field”] == “qam4096Light”

query = ‘from(bucket: “performance-quality-modulation”)
|> range(start: time(v: startdate), stop: time(v: enddate))
|> filter(fn: (r) => r._measurement == measurment)
|> filter(fn: (r) => r.ipaddress == ipaddress)
|> filter(fn: (r) => r.nename == nename)
|> filter(fn: (r) => r.slot == slot)
|> filter(fn: (r) => r._field ==str2)
|> yield(name: “last”)’

result = query_api.query(org=org, query=query, params=params)

while executing this query getting no result.
‘Process finished with exit code 0’
Can anyone please help me on this?