8 Replies Latest reply on Dec 23, 2014 6:43 AM by KK Molugu

    Can we dynamically change the datasource

    Manish Virmani

      Hi Everyone,

       

      Data source of my Dashboard is one table which have weekly data, for example this time we have data till  13_dec next week the data will be refreshed for all the previous weeks also, so we maintain previous all weeks data in different table.

      Database_tableA

      DataBase_tableB

      ...

      DataBase,tableZ

       

      User view the latest database table which is 'DataBase,tableZ' but client wants to view the data which is stored in table'DataBase_tableB' also so is there any way to give the user the access to select the database_table which he wants to access.

       

      I hope I have explained my problem.

       

      Thanks

      Manish Virmani

        • 1. Re: Can we dynamically change the datasource
          KK Molugu

          Manish:

           

          As you have incremental data in multiple tables and if the user wants the ability to see the data from a particular table, I would create a custom SQL to bring the data from the tables you want into Tableau. When you bring the data using Custom SQL, you can add a column to identify the source 'tableA', or 'tableB', ... 'tableZ'. You can use this new column as the multi-select filter for the user to select the data from table(s).

           

          Hope this helps.

           

          ..kk

          1 of 1 people found this helpful
          • 2. Re: Can we dynamically change the datasource
            Manish Virmani

            Hi Karunaker

             

            Thank you so much.

             

            This sounds to be the perfect solutions for my problem. I will further analyse this and hope to achieve it.

             

            Thanks Karunaker!!

             

            MV

            • 3. Re: Can we dynamically change the datasource
              Manish Virmani

              Hi Karunaker,

               

              I am trying to find out the way-out. So I created one access database which have three tables. So shall I import all the three tables in the tableau and create a new table(4th table) which have all the data(of 1-3 tables). In the new table(4th table) I create a new column which stores the table name.  Like this you are suggesting or I misunderstood something.

               

              Please help!

               

              Regards,

              Manish Virmani

              • 4. Re: Can we dynamically change the datasource
                KK Molugu

                Manish:

                 

                If you have three tables in Access, I would create a union query in Access to union all the tables as below and save a MyUnionQry

                 

                select 'table1' as table_name, * from table1

                union all

                select 'table2' as table_name, * from table2;

                 

                Using the union query, create a new select query to bring all the data from the union query as below and name as MySelectQry

                 

                select * from MyUnionQry;

                 

                When you connect to access db from Tableau MySelectQry will show up in the list of tables

                 

                Hope this helps

                ..kk

                • 5. Re: Can we dynamically change the datasource
                  Manish Virmani

                  Hi Karunaker

                   

                  Thanks for your response.

                   

                  With this way i am loading all previous tables in my tableau. In the access example i have taken only 3 tables, but when we have 20 or 30 table or more table thn loading those tables data will hit the performace of the dashbaord. Hope i am thinking correctly. Or it is not like this.

                   

                  Regards,

                  MV

                  • 6. Re: Can we dynamically change the datasource
                    KK Molugu

                    Manish:

                     

                    If that is the case, I'll bring the tables into Tableau and create a custom SQL and use that instead of loading them into MS Access. Where do you have your original data, I mean in which database?

                     

                    ..kk

                    • 7. Re: Can we dynamically change the datasource
                      Manish Virmani

                      Hi Karunaker,

                       

                      Thanks for your response.

                       

                      I had taken the example in access, i am loading data directly from my database. What my query is : as you suggested to bring all the tables(1 to n table)  in tableau and create a new table (New_table) which have all the data of table (1 to n tables data) . Will not kill the performance of dashboard..

                      So i am looking for changing the datasource dynamically, to give user option to select the tables for which weeks table he / she wants to see in the dashbaord. Based on the selection data will be loaded in the tableau.

                       

                      Regards,

                      Manish Virmani

                      • 8. Re: Can we dynamically change the datasource
                        KK Molugu

                        Manish.

                         

                        Performance depends on few things from database to data to view etc. In which database you have ur data and how many records in each table approximately

                         

                        ..kk