
You are preparing a report from Veeva CRM account and call activity data, but several fields are missing or inconsistent. Write a PostgreSQL query that returns one row per account for calls created in March 2024, showing the account name, territory name, a cleaned specialty, the number of completed calls, and a data quality flag.
Treat blank specialties and NULL specialties as missing and replace them with 'Unknown'. Treat specialty values case-insensitively so values like cardiology and Cardiology are standardized to Cardiology. If an account has no mapped territory, show 'Unassigned'. The data quality flag should be 'Needs Review' when either the specialty was missing/blank or the territory is missing; otherwise return 'Clean'.