nagarajmmu opened a new issue, #24704:
URL: https://github.com/apache/superset/issues/24704

   
   
   #### How to reproduce the bug
   
   1. We have view, which is having calculated column in it, calculated columns 
are **Percentage_total_for_Region** and **Percentage_Total_for_Entire_City**. 
below is the sample data.
   
   
![image](https://github.com/apache/superset/assets/61146310/0320e915-5330-4d96-ae03-98f05d974811)
   
   
   3. Example, Calculated column formula for **Percentage_total_for_Region** 
column is Sales/(sum of Sales per Region)
   5. Create Table chart, select "Region" in Dimension and 
SUM(Percentage_total_for_Region) in Metrics, as shown below
   
   
![image](https://github.com/apache/superset/assets/61146310/912e04b1-2ab6-454c-8e29-884ee48ddffa)
   
   7. Click on Update chart, everything will be fine, sum of 
Percentage_total_for_Region value 100  for EAST and WEST Region.
   8. If I select filter year = 2022.
   9. ERROR: Sum of "Percentage_total_for_Region" column for EAST is 83.33 and 
WEST is 73.33, as shown in screenshot.
   
![image](https://github.com/apache/superset/assets/61146310/70183888-c852-4491-a97d-d4b1601aa00c)
    
   10. Calculated column should sum the Sales after filter is applied, but here 
it is not working as expected.
    
   
   ### Expected results
   
   
![image](https://github.com/apache/superset/assets/61146310/420f6911-e61b-4a46-9678-3c072b7fbde2)
   
   ### Actual results
   
   what actually happens.
   
   
![image](https://github.com/apache/superset/assets/61146310/1dbbda29-c5a4-483f-b128-7805f6e73a5a)
   
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: Edge 114.0
   - superset version: superset 2.1.0 
   - python version: 3.8
   - any feature flags active: DASHBOARD_CROSS_FILTERS, 
DASHBOARD_FILTERS_EXPERIMENTAL, DRILL_TO_DETAIL,EMBEDDED_SUPERSET
   
   
   
   ### Additional context
   
   We are expecting calculated column formula should work after the filter is 
applied, so that value of "Percentage_total_for_Region" column will show the 
expected result, like if I select filter year is 2022, 
"Percentage_total_for_Region" column should show 100 percent, based on formula. 
   Formula Percentage_total_for_Region = Sales/SUM(Sales)
   Example if year is 2022, than for EAST Region total value is 100 percent as 
shown below data.
   
![image](https://github.com/apache/superset/assets/61146310/4ce12b4f-9f40-4c84-a5f3-f313ea5ed70d)
   
   But we observe that formula not calculating dynamically.
   
   Please help us how we can achieve this.
   
   @EBoisseauSierra do you have any alternative solution for above issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to