Xy graph multiple automatic series

Hi,

I am using the BigQuery connector to try and create an x y graph with days since release as the x and number of events as the x

I want each of the possible sources (source colum) to be there own series

I tried with the “Partition by values” transform and it works but i need to set up each series manually. The sources can change so it not ideal to have to keep updating

Is there a way to have a series per source automatically?

My sql is below:

    SELECT
      source,
      days_since_release,
      num_events
   FROM
  `table`

ORDER BY
  days_since_release

Welcome to forum @hello1ae5
Try

SELECT
      source as metric,
      days_since_release as [time],
      num_events as value 
   FROM
  `table`

ORDER BY
  days_since_release

And make sure the Format is time series and not table

i get a query syntax error with [time], is this still on the xy graph type?

days_since_release is just a number not a date

Do you want a time series graph?
Which column is date time

No i dont have a datetime field, which is why i thought the xy chart was the best choice

1 Like

duh apologies, you need to pivot your data either like this

SELECT days_since_release,
      [Vader III], [Sith V] 
   FROM (
    select 'Vader III' as source,
    34 days_since_release,
    232 num_events
    union
    select 'Vader III' as source,
    32 days_since_release,
    123 num_events
  union
   select 'Vader III' as source,
    34 days_since_release,
    232 num_events
    union
    select 'Vader III' as source,
    30 days_since_release,
    100 num_events
    union
    select 'Sith V' as source,
    3 days_since_release,
    22 num_events
    
    ) AS SourceTable  
PIVOT  
(  
  MAX(num_events)  
  FOR [source] IN ([Vader III], [Sith V],)  
) AS PivotTable;  

As you can see below the plugin wigs out and puts a metric as an Y value, which is incorrect.

or use apache echart multi line xy chart