if "Bandwidth" is an field, try like :
index=storage_arrays sourcetype=qos dev_name=$device$ qos_class=$class$ | eval qos_unit=if(qos_metric == Bandwidth, qos_bandwidth, qos_thruput) | chart avg(qos_unit) as "QoS" avg(qos_metric_value) as Limit over _time by qos_class | eval _span=4
or
if "Bandwidth" is an string , the you querry is verry OK .
... View more