Aman
11/03/2025, 11:18 AMkapa.ai
11/03/2025, 11:18 AMjson { "data": { "attributes": { "title": "Customer Lifetime Value", "description": "Sum of all purchases per customer", "content": { "format": "$#,##0", "maql": "SELECT SUM({fact/purchase_amount}) BY {attribute/customer_id}" } }, "id": "customer_lifetime_value", "type": "metric" } } You can adjust the MAQL expression to fit your retention logic, such as filtering for repeat purchases or specific time windows[Create Metrics using API](https://www.gooddata.com/docs/cloud/create-metrics/create-metrics-using-api/). ### 3. Handling Different Retention Frequencies - GoodData does not support dynamic, row-level conditional filtering within a single metric (e.g., automatically switching between weekly, monthly, or yearly retention based on membership type). - The recommended approach is to create separate metrics for each frequency (weekly, monthly, yearly) and display them side by side in your dashboard. Alternatively, preprocess your data outside GoodData to align retention calculations with the correct frequency before loading it into the platform[Community Slack Discussion](https://gooddataconnect.slack.com/archives/C04S1MSLEAW/p1757591134377139?thread_ts=1757591134.377139&cid=C04S1MSLEAW). ### 4. Visualization - Use Analytical Designer to create visualizations and calculated metrics from your defined metrics. You can apply date filters at various granularities and compare metrics over time[Calculate Metrics in Visualizations](https://www.gooddata.com/docs/cloud/create-visualizations/calculated-measures-in-insights/). --- Summary: - Prepare your data model with the necessary relationships and date granularities. - Define retention and lifetime value metrics using MAQL in the Metric Editor or API. - For different retention frequencies, create separate metrics or preprocess your data. - Use Analytical Designer to visualize and further analyze your metrics. If you need more specific MAQL examples or guidance on structuring your data model, let me know!Aman
11/03/2025, 12:19 PMYvonne Changamuka
11/03/2025, 4:15 PM