9 Replies Latest reply on Aug 2, 2016 2:39 AM by Mahfooj Khan

    custom sql query

    shravan kumar

      hi all,

       

      i am new to tableau.when we connect with sql server or excel.how to retrieve the data.please explain any body step by step.

       

       

      thanks in advance

      shravan kumar

        • 1. Re: custom sql query
          Mahfooj Khan

          Hi Sharvan,

          Few questions:

          Can you explain what you mean to say by retrieve here?Are you trying to make an extract of your data?

          Are you trying to load the data in tableau engine?

           

          Some useful link you can refer.

          Connect to Data

          Extract Your Data

           

          Feel free to ask If you've any question.

           

          Mahfooj

          • 2. Re: custom sql query
            Mark Fraser

            Hi Shravan

             

            Tableau offer plenty of training material via their website

            To answer your question, they are 1 page quick guides which should help Quick Starts

            This particular one >> Quick Start: Connect to Your Data

             

            Cheers

            Mark

            • 3. Re: custom sql query
              shravan kumar

              i mean ...

               

              i have 50 different  fields i want only 12 fields from data source how can i extract with custom sql query please explain by step by step.

              my can't allowed to share.please help with superstore data.

               

              thanks in advance

              shravan kumar

              • 4. Re: custom sql query
                Mahfooj Khan

                Here you go,

                You've to connect your data with Legacy connection first. Once you connect you'll get New Custom SQL option then you can write your sql like this and select only desired fields. But remember it will work only with excel data.

                 

                 

                Hope this help

                2 of 2 people found this helpful
                • 5. Re: custom sql query
                  Mahfooj Khan

                  If you're connecting your data from database then try to create a view with selected columns then connect that view in tableau.

                  • 6. Re: custom sql query
                    shravan kumar

                    Thank you mahfooj,

                     

                    when connect with  sql server also same query or any thing different with case sensitive.please let me know. if you have any links or document please attache me.

                     

                    how can mark correct answer ?

                     

                    Thanks once again,this is helped me so much..

                     

                    shravan kumar

                    • 7. Re: custom sql query
                      Mahfooj Khan

                      If you're connecting with excel then try to use the same nomenclature of your columns in your customer SQL statement like I've shown. Columns should be in "[]" and table name is actually the Sheet name which're connecting. Table name should be suffix with [Sheet$].

                       

                      As I've already said when you're connecting with any database like Oracle, SQL server then If your database table has so many columns and you wants only 10-20 columns from that. Then try to create a view of your table with required columns at database level and then connect with tableau. In tableau you wont get any custom SQL option once you connect with any database table.

                       

                      Else If you don't want to create any view then connect your database table in tableau. Create your viz using your required columns. Once done with creating your dashboard you can hide your unused dimensions and measure from the data source.

                      Later on If required you can unhide those fields also.

                       

                      I hope you got my point.

                       

                      If you get your answer then you can go to the relevant reply which you seems the correct answer there just above the action drop down you'll get a button of correct answer. Just click on that. It'll mark my reply as correct and this thread will be complete. Its a good practice.

                       

                      Mahfooj

                      2 of 2 people found this helpful
                      • 8. Re: custom sql query
                        shravan kumar

                        Thank you mahfooj.

                        • 9. Re: custom sql query
                          Mahfooj Khan

                          My pleasure! Kindly close the thread by marking my reply as correct. So that it may help others who have similar query.

                           

                          I've attached how to mark correct any reply. See the screen shot.