GitHub user Aruneem added a comment to the discussion: Custom Sql query Problem
1) SUM(CASE WHEN Brand = 'Metformin' THEN Sales ELSE 0 END) calculates sales totals for the brand Metformin. 2) Metformin is only used as an example; the dataset actually contains many different brand names. 3) Several brands appear multiple times in the dataset, so the query must handle repeated entries. You cannot hardcode Metformin into the query, since the goal is to work across all brands dynamically. 4) The query should be written at the Custom SQL level itself, without altering the database schema. Avoid queries that involve SELECT *; the solution must remain precise and controlled. GitHub link: https://github.com/apache/superset/discussions/40045#discussioncomment-16889369 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
