Dissociate label with postgresql datasource

Hi all,

I use postgresql datasource, and I’m trying to define return value label on a graph.

I have 2 queries which return 2 “series” (ht and ttc) for the same key (name), and I’m trying to distinguate values for having 2 different series per key instead of one.

Data is formatted like this :

date|name|ht|ttc
2018-09-10|toto|2|5
2018-09-10|titi|7|14
2018-09-11|toto|1|4
2018-09-11|titi|4|11

My request is

SELECT
$__time(date_sale::date),
name,
sum(order_lines.price_ht) as “ht”,
from orders
WHERE
$__timeFilter(date_sale)
group by orders.date_sale::date,name
order by orders.date_sale::date,name

SELECT
$__time(date_sale::date),
name,
sum(order_lines.price_ht) as “ttc”,
from orders
WHERE
$__timeFilter(date_sale)
group by orders.date_sale::date,name
order by orders.date_sale::date,name

For now, my 2 series are on graph, but with only 1 unique label (ex : toto)
I would like to have toto HT and toto TTC

I was using influxdb before, and with this datasource I could use “HT $tag_name” and “TTC $tag_name” for set correct label according to query I used.

How can I do this with postgres datasource ?

thanks
thomas