If you ID is unique, you may use min([Release Date]) in your calculation.
If you could attached a sample workbook with your issue would be much helpful
James, Zhouyi is correct - that should work.
When you see an aggregation error like this, the solution is usually to apply an aggregation to the OTHER field in the calculation. It can be anything at all but MIN, MAX or ATTR are usually safe, depending on the content of the data.
In your case, you are evaluating 2 dates - is it safe to assume that there is only one matching value in the primary data source (in other words, for a given client ID there is exactly ONE row in the table that contains Birth Date and ONE row in the table that contains Release Date)?
If that is guaranteed true, ATTR will be safe. If it is NOT true, you'll have to think carefully about whether MIN or MAX is the right aggregation (or something else entirely).
Hey Michael, There are many cases in the dataset where a client ID would have multiple birth dates because he/she may show up more that once because of having multiple release dates. Would this change the options in terms of MIN, MAX, or ATTR?
1 of 1 people found this helpful
I suspected that would be the case.
What's your goal, then? What do you want to see in your viz? ALL instances of a match? The oldest instance? The most recent?
ALL = ATTR
Oldest = MIN
Newest = MAX
And all those are "Probably" - you'll need to test them to make sure they do what you expect AND what you want (not always the same thing!).
Would like to see the number of records for every possible age. I have tried ATTR on both release date and date of birth - calculation was valid but it didn't return any data.
It would probably be easier to attach a workbook, but the information that is in the table is sensitive. I'm still fairly new to Tableau, so i'm not sure of a way to strip information before making into a packaged workbook.
Appreciate your time on this
I hear you on the data dilemma. Given what I do for a living, it's the primary reason I don't post more questions here. It would take me longer to sanitize the data than to figure it out myself!
This is going to turn out to be one of those issues where the way you're joining the data (blend vs. join, left vs. right, etc.) makes a huge difference to your solution. Have you tried (or can you try) swapping the Primary and Secondary data sources? Or trying a different join in the Data Source pane?
Is this a reasonable statement of your desired outcome?
Calculate the AGE value for a given USER ID + RELEASE DATE
Display a COUNT of each AGE value for each RELEASE DATE
I will try to swap the data sources around and see if that helps.
In the end I will probably try to add birthdate as a column in my primary source dataset. Would make everything easier in the end.
Thanks for your time on this!
Parting thoughts: you'll find it very helpful in the future if you can get really well educated on the differences between a Tableau Blend and a Tableau Join. I've found that if you don't understand why you should join 2 separate data sources in the workbook vs. join 2 separate tables in the Data Source pane, you'll end up not understanding why things don't work as you expect them to.
I think that will help you get to the bottom of this - but your plan to add a column to your primary source is a good one, too!
Would definitely prefer to do a Tableau Join, but my primary data source is a stored procedure in our database and i don't know of a way to join data to a stored procedure.
1 of 1 people found this helpful
Would your DBA consider providing you with a view fed by that stored proc instead? Or is that a big production?
Hadn't thought about that and it would solve the problem of not being able to link other data. I will run this by them on Monday.
Thanks for your help and have a great weekend!
You too, and good luck on Monday!