GitHub user dosubot[bot] added a comment to the discussion: Sunburst chart 
remove row from case-when query results

<!-- Greeting -->
Hey @muku! 👋 I'm here to assist you with bug fixes, answer your questions, and 
even help you become a contributor.

<!-- Answer -->
To remove the unwanted row that contains records not matching 'Val1' or 'Val2', 
you can modify your SQL query to include a condition that filters out these 
unmatched records. You can add a `WHERE` clause to exclude rows where the `CASE 
WHEN` result is `NULL`. Here's an example of how you might adjust your query:

```sql
SELECT
  CASE 
    WHEN text LIKE '%val1%' THEN 'Val1'
    WHEN text LIKE '%val2% %Akis%' THEN 'Val2'
  END AS category,
  COUNT(*)
FROM your_table
WHERE date_column BETWEEN 'start_date' AND 'end_date'
AND (text LIKE '%val1%' OR text LIKE '%val2% %Akis%')
GROUP BY category
```

This query ensures that only rows matching 'Val1' or 'Val2' are included in the 
results by adding the condition `(text LIKE '%val1%' OR text LIKE '%val2% 
%Akis%')` in the `WHERE` clause. Adjust the `date_column`, `start_date`, 
`end_date`, and `your_table` to fit your specific use case.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*

---
<sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/0fc597ba-cadd-4c66-9309-c0e376d2c0b8?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/0fc597ba-cadd-4c66-9309-c0e376d2c0b8?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/0fc597ba-cadd-4c66-9309-c0e376d2c0b8?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/0fc597ba-cadd-4c66-9309-c0e376d2c0b8?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/0fc597ba-cadd-4c66-9309-c0e376d2c0b8?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/0fc597ba-cadd-4c66-9309-c0e376d2c0b8?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/0fc597ba-cadd-4c66-9309-c0e376d2c0b8?feedback_type=other)</sup>


GitHub link: 
https://github.com/apache/superset/discussions/32895#discussioncomment-12650909

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