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

   ### Bug description
   
   I am using version 4.1.2.
   I encountered an issue!
   
   In SQL Lab, I write the query:
   SELECT
       TO_DATE('01.' || on_period, 'DD.MM.YYYY') AS "Дата отчетного периода",
       CASE
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '01' THEN 'Январь'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '02' THEN 'Февраль'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '03' THEN 'Март'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '04' THEN 'Апрель'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '05' THEN 'Май'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '06' THEN 'Июнь'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '07' THEN 'Июль'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '08' THEN 'Август'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '09' THEN 'Сентябрь'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '10' THEN 'Октябрь'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '11' THEN 'Ноябрь'
           WHEN SUBSTRING(on_period FROM 1 FOR 2) = '12' THEN 'Декабрь'
       END AS "Месяц",
       SUBSTRING(on_period FROM 4 FOR 4) AS "Год",
       revocable_deposits AS "Отзывные поля 1",
       irrevocable_deposits_1_6 AS "Безотзывные поля 1",
       credits_legal AS "Новые поля 2",
       credits_individuals AS "Старые поля 2"
   FROM dd11_rvsr.dd11405_dinamica_rvsr;
   
---------------------------------------------------------------------------------
   
   The query is executed, the database returns the data. I execute "Save or 
Overwrite Dataset"
   
![Image](https://github.com/user-attachments/assets/bddbcc8a-14f1-42a5-8999-ff4821958d6f)
   
   
   After switching to "Chart Source" I get the error -
   "Unexpected error
   Custom SQL fields cannot contain subqueries"
   
![Image](https://github.com/user-attachments/assets/48a56730-e71c-41af-ae0f-34026d23af05)
   
![Image](https://github.com/user-attachments/assets/88a464e7-5c70-4914-bda0-09ce312742c1)
   
   
   I noticed that there is a problem when adding "AS" in a column that has text 
with multiple spaces..
   How to fix this problem?
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


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