I've tried to open your workbook, but its asking me to connect to a MySQL connection, so I can't see what you've done. You need to extract your data and embed password.
If you have 2 data sets you want to combine then you will always need to have a common field in both which you can use to link them. Eg if you have cost centre and revenue in one data set and cost centre and cost in the other, then you can link on cost centre. If you have date and revenue in one and date and cost in another you can link on date. If you don't have anything in common between the two data sets, then you can't join them. This is no different than if the data was in 2 tables in SQL Server, 2 sheets on Excel, 2 tables in Access DB etc etc.
Assuming you do actually have a field in common, then you'l need to use blending to link the data together.
Data source 1 - Revenue
Cost Centre Revenue
Data source 2 - Cost
Cost Centre Cost
Then you can combine data from these 2 data sources onto one view with a blend
The Cost data source above is the 'secondary' data source as it has an orange icon (blue means primary). The Cost Centre dimension in the Cost data source has a link icon to show how the 2 data sources are joined. As both data sources have a field with same name, Tableau automatically adds this link. If you have dimensions containing the same data but not named the same, you can manually define the relationship vie Data -> Edit Relationships menu
Once you're happy you've got the 'raw' numbers you want on a single view, you can then create a calculated field in the primary (blue) source (Revenue in this case) for your % Production Cost which will look something like
As the [Cost] dimension is coming from the secondary data source (called cost), then it is prefixed with the data source reference highlighted.
Packaged workbook in v10.5.3 attached.
Hope that helps.
Forum Q.twbx 14.7 KB
Thank you for your help,
I figured it out blending my date.
Now i have another issue : if i want to divide my cost that is already filtered by cost center by revenue of this cost center, should i link them also per cost center ?
If you have cost center in both data sources, then yes, you should blend on both date & cost center.
If my previous post helped you get what you needed from your original question, then please mark it as correct.
You're going to need to attached a packaged workbook with some sample data if need be, that is set up based on how your data is structured. What you're asking for sounds achievable (and is what I've already provided in the workbook), but the way your data is structured and what your data contains, may not be as per my assumption.
Having packaged workbooks helps to remove all the ambiguities and assumptions that are being made.
Please refer to the following article to understand how to create a packaged workbook, and why we ask for it. A screen shot or explanation of exactly what numbers you're expecting to output based on the example is also useful.