Can you not use Cross-data-source joins for this?
The sources are joined with student [ID].
The thing is, Tableau says all fields must be aggregate or constant when using fields from multiple data sources.
So while this works fine:
IIF([SR] = [Result], [ID], null)
I can't use this:
IIF([SR] = [Result], [vStudentClasses].[Student Preferred], null)
Note: I have just found IIF(attr([SR]) = attr([Result]), attr([vStudentClasses].[Student Preferred]), null) DOES work if there is only ONE underlying row. Otherwise it results null, not *.
I can kind of understand why IIF([SR] = [Result], [ID], null) works but IIF(attr([SR]) = attr([Result]), attr([vStudentClasses].[Student Preferred]), null) doesn't (unless there is only one underlying row).
However, I can't see a way around it, as I have to use an aggregate.
I tried using an LOD expression to force it to "aggregate" only a single row but all fields in an LOD expression must come from the same data source too...
I may be misunderstanding but...
1) So you have 2 data sources that you are blending?
2) Your field IIF([SR] = [Result], [ID], null) works in the first data source correct?
3) Your second data source is just meant to bring the names over for the appropriate id?
Then you can just blend and link based on your calculated field in the first data source matching the id in the second data source.
Ill try to attach a workbook as an example in a second.
1 of 1 people found this helpful
Hi here's, a workbook as well as two excel files that i am assuming are similar to your two data sources. Hopefully it helps. I used my times from high school because i couldn't help myself.
I created "Record id", a calculated field that is basically yours from above. I just had to wrap it in a fixed lod calc to make sure every row for the event gets that id.
Then you just have to define the relationship between your second source so that it matches that record id to the id from the second source.
Go to data -> edit relationships
Then set the relationship so the record id matches the id.
Thank you so much for your help. Not bad times either!
However, because I already have a relationship between [ID] in both data sources (which I need for other sheets), it wouldn't let me create another.
I think I have found a solution that works, though. Most names are now showing up (and the reason for the names that are still missing is, I think, another issue related to file years).
I created a new calculated field called [SR Student Filter] with the following code: IIF([SR] = [Result], 1, 0)
I then added [SR Student Filter] as a filter to only show values equal to 1.
This seems pretty simple, but it seems to have fixed the problem (hopefully).