What exactly have you done there? I cannot use multiple measures, that is why I am creating "Final Value" which sums both datasources based on type.
Can you give more details as to the desired algorithm and the expected results? For example you want a calculation based on Type, there are three separate conditions for a given ID:
one type (A)
one type (B)
two types (A & B)
Which measure (primary or secondary) should be chosen for that?
Also is there any reason not to join the two data sources together? Even though the 2nd datasource's values would be replicated (since it's at the grain of ID and not ID & Type) we can work with that and avoid some of the challenges of data blending.
Helll Jonathan, secondary data source has only one kind of type and i will check in main source, if the type is A for instance, get measure from second source.
I cannot join because these are Server datasources. Shame on Tableau for still not allowing that.
Note the Type (copy) dimension on Detail. That is necessary for the following reasons:
a) We have to use a data blend due to not being able to join on Tableau Server Published Data Sources.
b) We need to return the measure depending on the type from different data sources.
c) Blended calculations only work on aggregations, not row-level calculations.
d) In order for the determination of Type to work inside the Grand Total (as an aggregation per c) we need the Type as a dimension in the Grand Total. That's what the Type (copy) is for.
e) Then because the Type (copy) will generate a mark for each type in the GT we need an aggregation across types. I used the duplicated dimension technique from http://drawingwithnumbers.artisart.org/customizing-grand-totals-part-2/ to create this:
The compute using of this table calculation is on Type (copy).
Finally I turned off Analysis->Stack Marks to get a compact layout.
In the attached workbook there's also a workout view showing the calcs together.
PS: If you'd like this to be easier please vote up https://community.tableau.com/ideas/1232 so we can get "two pass" aka "visual" totals across data blends.
BlendandGT2 jtd.twbx 65.1 KB
Thanks a lot, Jonathan!