Using alias or regex for Visualization Graph to draw a stacked histogram

Hello,

I’m working with an MSSQL and use this query atm to display a histogram:

SELECT OrdNr
      ,TM_ID
      ,Test_Nr
      ,ExeValue
INTO #TMPTESTDATA FROM databASe.data
WHERE OrdNr = $OrdNr
  
SELECT ExeValue AS value, Concat(Concat('TM_ID-',TM_ID),Test_Nr) AS metric, CURRENT_TIMESTAMP AS time FROM #TMPTESTDATA
WHERE TM_ID = $TM_ID AND Test_Nr IN ($Test_Nr)

My data is hierarchically ordered: TM_ID.TEST_NR.ExeValue

One histogram can comprise the following data:
TM_ID = 10,
TEST_NR = 1
ExeValue = (1,2,3,4)

The second
TM_ID = 10,
TEST_NR = 2
ExeValue = (1,1,4,4)

I would like to stack now the two histograms but don’t know how :frowning:

Happy Halloween :smiley:

Oliver