Conditional logic in influx 2.0

Hi,

Is it possible to use the if else conditions to use other queries? For instance, if a variable is 1 show the data of bucket1, measurement1, _field == name, and else show the data of bucket2, measurement2, field == lastname.