models: # Base model representing cultural entities - name: culture description: Core model for cultural groups dimensions: - name: cultureid description: Unique identifier for the culture - name: name description: Culture name options: ["Western", "Eastern"] measures: - name: revenue description: Revenue generated by the culture filters: # Complex filter using columns from logins and subscriptions - name: active_subscribed_customer expr: logins.login_count > {threshold} AND subscriptions.subscription_status = 'active' args: - name: threshold type: integer description: Minimum number of logins description: Customers with logins above threshold and active subscription metrics: # Metric using entity columns, requires deduplication for many-to-many - name: popular_product_revenue expr: SUM(revenue) WHERE culture_products.product_count > 5 description: Revenue from cultures with popular products entities: - name: logins primary_key: cultureid foreign_key: cultureid type: LEFT # Explicitly set, but LLM could override cardinality: one-to-many description: Links to login activity - name: subscriptions primary_key: cultureid foreign_key: cultureid cardinality: one-to-one description: Links to subscription data (no type, LLM decides) - name: culture_products primary_key: cultureid foreign_key: cultureid cardinality: many-to-many description: Links to product associations (many-to-many via junction) # Model for login activity - name: logins description: Tracks user logins by culture dimensions: - name: cultureid description: Foreign key to culture measures: - name: login_count description: Number of logins entities: - name: culture primary_key: cultureid foreign_key: cultureid cardinality: many-to-one # Model for subscriptions - name: subscriptions description: Subscription status for cultures dimensions: - name: cultureid description: Foreign key to culture - name: subscription_status description: Current subscription status options: ["active", "inactive"] entities: - name: culture primary_key: cultureid foreign_key: cultureid cardinality: one-to-one # Junction model for many-to-many between culture and products - name: culture_products description: Junction table linking cultures to products dimensions: - name: cultureid description: Foreign key to culture - name: productid description: Foreign key to products measures: - name: product_count description: Number of products in this association entities: - name: culture primary_key: cultureid foreign_key: cultureid cardinality: many-to-many - name: products primary_key: productid foreign_key: productid cardinality: many-to-many