GitHub user partha-smsrc created a discussion: custom SQL QUERY: FINDING TOTAL 
SALES FOR DISTINCT BRAND AS ATTACHED IN THE XLS

I have a dataset containing two columns: Brand and Sales. One of the brands, 
Metformin, appears multiple times, and some sales values (such as 50 and 30) 
are also repeated.
I want to create a Total column that calculates the sum of sales considering 
only distinct brands. For example, given sales values of 40, 50, 50, 30, and 
30, the total should be 200. However, since Metformin appears more than once, 
it should only be counted once when calculating this total.
Additionally, I will be writing this logic using custom SQL at the chart level, 
not directly on the database, so I cannot use a full query structure like 
SELECT * FROM ....
[Dataset 
(1).xlsx](https://github.com/user-attachments/files/28826417/Dataset.1.xlsx)

@dosu

GitHub link: https://github.com/apache/superset/discussions/40964

----
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]

Reply via email to