Skip to main content

've trouble understanding how this should work...basically I've 2 main tables, in one I've Revenues, in another Costs.

Revenues table has fields as: P&L (string), Category (string), Products (string), Sold (int), invoiced (int), delivered (int), date (date).

Costs table has: P&L (string), Category (string), Products (string), Costs (int), date (date).

I'd like to use tables together to perform various calcs like margin, for example, at any level (total margin, which means total revenues - total costs, or at Category level for which I should be able to filter any category I have and perform the calc and so on). Problem is, any tentative I've made to use relations or join, resulted in duplications.  

Plus, another problem I 've seen it appear is that, if I want to split by date costs, but I use the date column from the revenues table, even if the date is the same (I've done a copy/paste between tables basically), tableau doesn't recognize the date correctly, so to split costs, I've to use costs'date column, and to split revenues, I've to use revenues' date columns, which is frankly a pain...

 

So my question: how could I merge the 2 tables in one, or anyway how could I put all the data together in a working table to perform any kind of calcs,and also how could I use just 1 column for date that works for all the date altogether?

I've upload a file here to understand better what I'm trying to combine. Thank you guys

1 件の回答
  1. 2023年1月27日 23:52

    Do a union, and create calculated fields to merge columns with different names to one and proceed from there.

0/9000