1) Depends on how they are related and whether the two tables are in the same database. If so, just do a standard Join in the tableau data connection window. If there is simple logic you could just use a calculated field instead.
2) Sort of. You just want a standard join, I think. Just select multiple tables from the initial data connection window. (It may be that you want something more complicated, in which case you might even need Custom SQL)
3) Whenever you duplicate a field in Tableau, you are not duplicating it in the database, merely in the meta-data layer. Duplicates have to be named something else ("copy" by default, but rename it if you want).
These are the first round answers, but it may be that you need deeper replies, depending on exactly what you are trying to do. I'd also recommend looking at the connecting to data videos from the Tableau online training videos. (Training & Tutorials | Tableau Software)
1 of 1 people found this helpful
To combine two tables with no common fields, you'll need to use a customsql query ( when connecting to data, under step 2 select custom sql').
CROSS JOIN returns the Cartesian product of rows from tables in the join - it'll produce rows which combine each row from the first table with each row from the second table. In a dummy data set, if I have two tables: Test1 with columns A,B,C & Test2 with D,E,F. I would use the following statement:
SELECT [Test1$].[a] AS [a],
[Test1$].[b] AS [b],
[Test1$].[c] AS [c],
[Test2$].[d] AS [d],
[Test2$].[e] AS [e],
[Test2$].[f] AS [f]
Alternatively - SELECT * FROM [Test1$], [Test2$]
To duplicate in Tableau - right click the dimension and select 'Duplicate'.
Thnk you Thasan for your reply,
I want exactly to add a field from an Excel file, Sheet 1 to a table which added from an oracle database.
How can I do that with Sql when I want to modify connexion.??
I presume this is a third table? and a separate data source? does the third table have any relationship to other tables?
If additional table has a relationship - Import the Excel file and create a separate connection. If it's a lookup table, you can even past the data, Data > Paste Data. To join this table to previously imported tables, Data > Edit Relationships.
If it doesn't have relationship and data is from multiple sources - Custom SQL is not written at the table level, rather when creating the connection. Therefore, you might consider importing excel file into oracle and then writing a custom sql in tableau to import from that single connection - or create a view in oracle.