Query not recognising text variable

  • What Grafana version and what operating system are you using?
    Version 9.3.2
  • What are you trying to achieve?
    I am trying to create a dashboard where the user can enter a 13-digit ID into a variable I’ve added to the dashboard, and this will update the panels I’ve created to show results for this ID.
  • How are you trying to achieve it?
    The variable is called isbn_entry. The default is blank, and the user has to enter the ID into the variable to bring up results. The variable has been created as a text box variable. The SQL queries in the panels have been set up to look at the variables I’ve created. I’ve also created a variable for site id, as we have different stores, and this works as expected
  • What happened?
    The panels don’t update, but instead time out after a couple of minutes.
  • What did you expect to happen?
    I expected to see the panels update with sales/order information of the ID entered
  • Can you copy/paste the configuration(s) that you are having problems with?
    The query is:
    eop.isbn_thirt as “ISBN”
    ,CONCAT(b.title,if(length(subtitle)>0, CONCAT(": ",subtitle), ‘’)) AS “Title”
    ,CAST(b.publication_date AS DATE) AS “Pub date”
    ,sum(case when eop.order_placement_stock_status_id=6 then eop.quantity ELSE NULL END) AS “Sales”
    ,SUM(case when eop.order_placement_stock_status_id=6 then (eop.total-eop.tax) ELSE NULL END) AS “Sales value”
    FROM ecommerce_orders_products eop
    LEFT JOIN ecommerce_orders eo ON eop.order_id=eo.id
    LEFT JOIN books b ON eop.isbn_thirt=b.isbn_thirt
    LEFT JOIN ecommerce_orders_paymentsubmit_monitor pm ON eo.id=pm.order_id
    eo.site_id = $site_id
    AND eop.isbn_thirt = $isbn_entry
    AND eo.order_status_id IN (‘3’,‘6’)
    AND cast(eo.created_date AS DATE) >= cast(b.publication_date AS DATE)
    AND CAST(eo.created_date AS DATE) <= DATE_ADD(CAST(b.publication_date AS DATE),INTERVAL 7 DAY)
    GROUP BY eop.isbn_thirt
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

504 Gateway Time-out

504 Gateway Time-out

  • Did you follow any online instructions? If so, what is the URL?

Welcome @briteide

What happens if you try that same query outside of grafana by providing the parameters used in grafana manually using an external querying tool