This query isn't working and I can't understand why. It comes up with the error message "Unknown table or alias 'Source1' used in select query." when it is clearly defined in Line 12. If I remove "Source1." from in front of the columns in the select list it shows "Whenever a table alias is defined, kindly use table alias name before the respective columns used in SELECT query".
SELECT
Source1.week,
Source1.[2024],
Source1.[2025]
FROM
(
SELECT
Year("Created Time") AS year,
Week("Created Time") AS week,
"Trollies"
FROM "Shipment Order (Zoho Inventory)"
) AS Source1
PIVOT
(
SUM("Trollies") FOR [year] IN ([2024],[2025])
) AS Pvt