Additional column only for data links

Hi There,

i have a graph panel and would like to add data links to it.
Unfortunately i need one more column from my database (id). I dont need the id column for my graph panel and it is no metric itself.
The id colum is a link to a foreign system.
When i add the id colum to my sql statement, grafana draws it like another metric.
When i use the transformation to hide the id column it is not visible in datalinks.

Any idea on this?

Hi,

If you can a screenshot, it would be helpful

Thanks

Hi!

My Statement for one of the three series:

SELECT 
  created_at AS "time",
  first_response_in_min AS "Eskaliert"
FROM (
SELECT DISTINCT
  tickets.created_at,
  first_response_in_min,
  tickets.id
FROM tickets
LEFT JOIN organizations
  ON tickets.organization_id = organizations.id 
LEFT OUTER JOIN tags
  ON tags.o_id = tickets.id
WHERE
  $__timeFilter(tickets.created_at)
  AND tickets.group_id IN (${v_groups})
  AND COALESCE(product, 'N/A') SIMILAR TO '%(${v_products:pipe})%'
  AND COALESCE(tickettype,'N/A') IN (${v_tickettypes})
  AND first_response_diff_in_min < 0
  AND tickets.state_id IN (${v_ticketstates})
  AND COALESCE(tickets.organization_id,0) IN (${v_organizations})
  AND COALESCE(gst, 'N/A') IN (${v_gst})
  ${v_closedbycustomer}
  AND COALESCE(tag_item_id, '0') IN (${v_tags})
  AND COALESCE(chargeable, 'N/A') IN (${v_chargeable})
) inner_query
ORDER BY 1

I need the “id” column from the datasource to create the datalink.
When i add it to my sql statement grafana adds it as additional series.

Hi,

You can use the transform tab to hide column :

Hope it helps

Good Luck

Thanks for your answer!

When i hide the “id” column it is not possible to select it in data links :confused:

Yes, long standing bug: Table: Ability to hide fields but still reference them in data links · Issue #24092 · grafana/grafana · GitHub They postpone it regularly.

1 Like