SELECT
  'table' AS component,
  TRUE AS sort,
  TRUE AS search,
  TRUE AS striped_rows,
  TRUE AS small,
  'Price' AS align_right,
  'Quantity' AS align_right,
  'Unit' AS align_right,
  'Notice' AS markdown
;
SELECT
  to_char(ts
     AT TIME ZONE 'Pacific/Auckland', --COALESCE('$ParameterTZ', 'Pacific/Auckland'),
    'Mon DD HH24:MI:SS'
  ) AS "Time",
  description AS "Description",
  code AS "Store",
  product AS "Product",
  category AS "Category",
  "group" AS "Group",
  CASE WHEN organic THEN 'yes' ELSE 'no' END AS "Organic",
  to_char(price, 'FM999999999.00') AS "Price",
  to_char(quantity, 'FM999999999.000') AS "Quantity",
  unit AS "Unit"
FROM sqlpage_txn;

SELECT '# No Data' AS "Notice"
WHERE NOT EXISTS(SELECT * FROM sqlpage_txn LIMIT 1);