Before writing a CREATE SEMANTIC VIEW statement:
- Read
references/parameters.mdto review all available parameters and their defaults. - For each parameter, decide whether the user's request implies a non-default value.
- Include only the parameters that differ from the default or that the user explicitly requested.
- Never use
CREATE OR REPLACE— always useCREATE SEMANTIC VIEW IF NOT EXISTSwhere supported. - Every semantic view must include a
TABLESclause; at least oneDIMENSIONSorMETRICSclause is also required for the view to be valid. - Define
RELATIONSHIPSwhenever two or more logical tables must be joined; specify join type (standard, ASOF, or range) explicitly. - Populate
AI_SQL_GENERATIONwith concise natural-language instructions that guide Cortex Analyst when generating SQL from the view. - Mark fact expressions
PRIVATEwhen they should not be exposed directly to end users; dimensions are alwaysPUBLIC.