Tableau - Blend Multiple Tableau Server Data Sources - tableau-api

I have three Tableau Server data sources in a workbook that represent three tables in a database. Table A is joined to Table B and table B is joined to Table C. There is no foreign key relationship between Table A and Table C, but the implicit relationship exists through Table B (junction table). When using Table A as the primary data source on a report, I receive an error message when attempting to add data from Table C.
In order to use fields from Table C, a relationship needs to be created with Table A. Select Data > Edit Relationships to open the Relationships dialog box.
Is there any way to join multiple Tableau Server data sources to accomplish the described scenario?

Tableau has the concept of Primary and Secondary data sources, and every secondary needs to have a key into the primary to be considered. You can't link a secondary to a secondary data source.
My suggestion here would be creating another data source already joined/blended. This can be done by connecting directly to the database and joining the tables using Tableau wizard (see image below):
Or, if you feel comfortable, you can use the New Custom SQL button and use your own query (see image below):

Related

How to get all external in db2 using a system tables information

I need to get complete list of external tables in db2 database. I have defined schema called DB2INST1. How to get complete list of external tables information using system tables?
The information lives in syscat.tables (documentation here) for Db2-LUW databases that support external tables, which have their PROPERTY column with value Y in position 27 of that column.
Example query returns the fully qualified name of external tables:
select trim(tabschema)||'.'||rtrim(tabname)
from syscat.tables
where substr(property,27,1)='Y'
with ur;
In general, the best and most reliable way to retrieve all information and to recreate the DDL statements for tables is to use the db2look tool. If you want to extract the metadata on your own, there are some catalog views to start with:
SYSCAT.TABLES holds the table information. Look for the PROPERTY column and check there if it is an external table.
SYSCAT.COLUMNS has the basic column information. But there are more related tables depending on types and attributes.
SYSCAT.EXTERNALTABLEOPTIONS shows the actual options for an external table, the things in addition to what makes a regular table.
There are many more tables to hold table properties, depending on the complexity of the table and column definitions.

How to copy all column names and data types from table in DBeaver?

So I have this table with a LOT of columns. And I am trying to do pxf connection from another database where this table is. Are there any way I can copy or export maybe all
column name - data type pairs, so I won't have to announce it one by one in while creating external table?
You could generate the DDL from that table and use it as you need, by clicking right mouse button and selecting from menu Generate SQL-->DDL.

Postgres table sync between different schemas

I have table A in schema A and table B in schema B with same structure in the same database. Whenever a DML change happens in table A, I need the same in table B. For now, I am using triggers to do the same. Is there any better alternative than using triggers for this scenario?
As the tables belong to different microservices, I need one of the tables with data unmodified even if the other table is dropped.

How to join the tables in Tableau as they are joined in ER diagram

I want to join tables in tableau but, when I am adding any table to join it is getting joined with the 1st table I added irrespective of keys. Even if tables do not have same keys table is getting joined.
Example: Sales to be joined with OnlineSales and Customer to be joined with OnlineSales but Customer is getting joined with Sales.
I tried using custom SQL as well but it is not working.
Click on the Venn diagram icon for the join and set the left and right keys as desired. You can choose different tables for each join key; you aren't limited to the ones listed first. After you save your join key choices, the diagram will update to show which tables are involved.
No need for custom SQL. In fact, save custom SQL for the rare situation where Tableau gives you no other choice because Custom SQL prevents useful query optimizations.

MySQL Workbench... Populating the fk column

I'm brand new to MySQL Workbench and a have a bit of experience with databases (MS Access). I'm having trouble populating my fk with data. Here's what I have in my db schema:
2 tables Block and Set (Block having a pk Block_ID (type of INT); Set having fk to Block with fk name Set_Block_ID (type of INT).
1 to many relationship created from Block to Set tables linking Block_ID to Set_Block_ID. Relationship created, no problems
I populate the Block table with data. No problems
I then go to populate the Set table with data. I can see all my columns but not the fk. My question is why?
I have created the exact same db in MS Access and my fk is displayed in the linked table and I can populate it while MS Access makes sure referential integrity is enforced. I'm really brand new to Workbench and cant figure out why I cant see and populate my fk column.
Any help is appreciated!
Thanks!! =)
After having digested all the replies to my question (note sarcasm here) I have finally found a workaround way of solving the issue. To recap:
ISSUE:
created a simple 2 table relationship with Workbench with PK and FK (1 .. n relationship)
FK column not visible in Table Edit so not possible to enter any referencing data
SOLUTION:
installed SQLyog and connected to same server
opened same database and redid the simple 1 .. n relationship
FK column visible for editing in SQLyog
likewise, FK column visible for editing in Workbench
As I said, I'm new to this whole thing so I don't know what the problem was in Workbench. I just know it seems to be working fine now.
As you have noticed, the relationship drawing tool does not create actual foreign key constraints.
However, if double-click the referencing table and switch to the foreign-key tab, you can create references and specify the columns involved. This generates and maintains the visual linkage automatically: