2 Replies Latest reply on Jan 30, 2017 9:30 AM by Jaskaran Dhillon

    Error while trying to create a simple dashboard using New Custom SQL

    Jaskaran Dhillon

      Hi Team,

      I have a query which is running perfectly fine in Microsoft SQL Server. I am trying to create a dashboard using that sql however getting an error mentioned below.

       

      Error message - An error occured while communicating with data source 'Showdata'

       

      Below message is showing when i click on "Show details"

       

      SQL custom query.PNG

       

      The following is the SQL query I am trying to create within Tableau:

       

      select * spine.year         

      ,spine.year_end_date            

                        ,count(Account_Number) as accounts

      ,sum(de.Account_Total_Market_Value) as AUM        

                        ,sum(case when de.account_total_market_value>=250000 and de.account_total_market_value<500000 then 1 else 0 end) as accounts_gt_250K

            ,sum(case when de.account_total_market_value>=250000 and de.account_total_market_value<500000 then de.Account_Total_Market_Value else 0 end) as [AUM: $250K to $499K] 

                        ,sum(case when de.account_total_market_value>=500000 and de.account_total_market_value<1000000 then 1 else 0 end) as accounts_gt_500K

            ,sum(case when de.account_total_market_value>=500000 and de.account_total_market_value<1000000 then de.Account_Total_Market_Value else 0 end) as [AUM: $500K to $999K] 

                        ,sum(case when de.account_total_market_value>=1000000 then 1 else 0 end) as accounts_gt_1M

            ,sum(case when de.account_total_market_value>=1000000 then de.Account_Total_Market_Value else 0 end) as [AUM: $1MM+]

                        from t_deivrmin_all de

            inner join     

           (select year(report_date) as year, max(report_date) year_end_date from t_deivrmin_all          

            where report_date<=              (select as_of_date from RPT_Report_Date where report_id='14' and report_name='Management Report - Month End Date')

            group by year(report_date)) spine on spine.year_end_date=de.report_date 

                        group by spine.year     

      ,spine.year_end_date           

            order by spine.year 

      ,spine.year_end_date           

       

       

      Thank you in advance,

       

      Jaskaran