1 Reply Latest reply on May 16, 2018 10:59 AM by Michael Prokop

    Custom SQL Plus another Datasource

    David Matthews

      I have a dashboard that is using custom sql to pivot ticket data. Something like the below. It has worked to allow me to create dashboards based on that table. Now I need to do some filtering by columns in another table. Can you *** the 2nd table in the same dashboard and join it to the custom query assuming it has a common field. So the datasource tab would have Custom SQL QUery plus another table that are joined?

       

      SELECT [CASENBR]

            CASE_NBR

             ,CREATED_DT

            ,CREATED_DT as [Date Used]

            ,CLOSED_DT

            ,'Opened' as [Event]

            , +1 As [Total]

        FROM table1

      UNION ALL

      SELECT [CASENBR]

             CASE_NBR

            ,CREATED_DT

            ,CLOSED_DT

            ,CLOSED_DT as [Date Used]

            ,'Closed' as [Event]

      , -1 As [Total]

        FROM table1