Skip to main content

Hi All,

 

I have two data sources - one is a SQL table with customer accounts, call events and product holdings before and after the call event over a period of time (one account can have multiple call events). 

Calculating net revenue using two data sources

The second data source is a 'rate card' in Excel containing the price for each product. Essentially what I want to do is calculate the net revenue before and after the call event for each call event using the rate card as a sort of 'vlookup' table. Below is the rate card data structure for the premium product.

pastedImage_10.png

I've connected my Tableau workbook to the two data sources and created relationships between the primary (SQL table) data source and the secondary (Excel) data source (excerpt shown below). Note I had to create two columns for each product type in my rate card table as Tableau wouldn't let me create multiple relationships to the same field in the SQL table.

pastedImage_3.png

My problem is to do with creating the calculated fields for pre and post net revenue. This was my first attempt:

pastedImage_12.png

but this is summing the whole base price column for each account so is incorrect. After googling the problem I attempted to use the FIXED level of detail (LOD) function but found I couldn't use the function on fields from multiple data sources.

 

Can you please suggest the best way to calculate pre and post net revenue? Unfortunately I can't upload the Tableau workbook due to confidential data.

 

Any help here is much appreciated. Please let me know if you require further details.

 

Regards,

 

Aoife

1 answer
  1. May 9, 2017, 8:45 PM

    Hey Aoife,

     

    Thanks for asking such an in-depth question. If you check out Anonymize your Tableau Package Data for Sharing you may be able to create a workbook you can upload. I know much of our community will require that to provide a helpful answer.

     

    -Diego

0/9000