I am using parameters in Amazon Redshift, so that I can pass them directly from Dashboard. The query works in Data Prep but Dataset fails with Import Error.
The parameters:
DateFrom
– Day – 2024-01-01
DateTo
– Day – 2025-01-01
The query:
SELECT org_uid, COUNT(DISTINCT item_uid) as active_items
FROM organizations_activity
WHERE item_updated_at BETWEEN <<$DateFrom>> AND <<$DateTo>>
GROUP BY org_uid
Query works fine and shows results apply it with Auto-preview in Data Prep. But saving dataset fails:
Refresh error details
Error type: 0 Learn more
Error details: ERROR: syntax error at or near "$" Position: 411
I tried to replace <<$DateFrom>>
and <<$DateTo>>
constriction with :DateFrom
and :DateTo
construction, but in this case I get syntax error already in Data Prep stage.