我相信这是一个简单的问题,但由于我不熟悉 redash,所以它似乎很难。
我有一个redash中的查询,
SELECT si.variant_id,
v.sku,
COUNT(CASE
WHEN a.viewable_type = 'Spree::Variant' THEN a.id
END) AS photo
FROM spree_stock_items si
LEFT JOIN spree_stock_locations sl ON sl.id = si.stock_location_id
LEFT JOIN spree_assets a ON si.variant_id = a.viewable_id
LEFT JOIN spree_variants v ON v.id = si.variant_id
WHERE-- viewable_type = 'Spree::Variant'
sl.name='{{store_location}}'
AND si.deleted_at IS NULL
AND sl.country_id = '2'
GROUP BY 1,
2
ORDER BY 1
LIMIT 200000
截至目前,我可以在store location
. 但现在我想query filter
根据列添加photo
。我该怎么做?store location
基本上我想通过列中的和计数来过滤redash仪表板中的结果photo
。