5 Replies Latest reply on Sep 24, 2018 6:57 PM by Vincent Baumel

# Still baffled by the Tableau Prep Aggregate step

Hi friends-

I'm running into a problem with a join. Looking at the resulting granularity of my data it's something akin to this:

Start_TimeEnd_TimeNameDepartmentActivity_CodeMeasurement

Reason_Code

9/1/2018 12:08:39 AM9/1/2018 03:15:24 PMVince400408150.113333
9/1/2018 12:08:39 AM9/1/2018 03:15:24 PMVince400408150.08753
9/1/2018 12:08:39 AM9/1/2018 03:15:24 PMVince400408150.249173
9/1/2018 12:08:39 AM9/1/2018 03:15:24 PMVince400408153.912223

I've got multiple rows in which the only difference is the Measurement field. What I'd *like* to do is roll those up so that each row has only one Start_Time. Since Tableau Prep materializes things like LOD calculations, I know my solution probably involves the Aggregate step. I've watched the training videos and everything, but I'm still just a bit confused about how to make this work. I feel like the answer is simple, I just can't wrap my head around it. Can someone explain this to me?

-Vince

• ###### 1. Re: Still baffled by the Tableau Prep Aggregate step

Vince,

Just to clarify, you want to roll up the example rows above into a single row?  Since everything is the same, except Measurement, that would be the big question: what do you want to happen to Measurement?  Do the values get added together, averaged, keep only one of them (and which one?)

Or maybe there's another solution altogether?  For example, is the join splitting out what used to be a single row into the rows above?  If so, why are there different values for Measurement?

I guess it might just take a bit more context or at least clarification to get to an answer.

Best Regards,

Joshua

• ###### 2. Re: Still baffled by the Tableau Prep Aggregate step

Looking at it, I think your note about the join splitting it out might be on to something. Each of my data sources have start_time, end_time, and a measurement. The times from one don't necessarily match the times from the other though, so I can't use them as a join condition. I'm joining on one of the dimensions but I'm still ending up with multiple measurements per start_time. Maybe that's the problem? I'm joining on a dimension, so the granularity difference is too great?

Sorry if this seems like rambling. Here's what I'm looking at. actual_hours is the measurement I want for each start_time.

• ###### 3. Re: Still baffled by the Tableau Prep Aggregate step

So I found a temporary workaround, but my initial confusion about the Aggregate step still stands. What I did was use Prep to create my custom SQL extract, then use that as a primary data source in Tableau Desktop. I then brought in my other data as a secondary data source, and established a relationship based on the dimension AND the month/year of my start_time fields. From here I can compare at a month level, and it gets me most of the way there.

As far as the Agg step goes, should you just put the fields you want to keep the same on the left side (grouped fields) and the fields you want aggregated on the right side? Any you don't place don't make it through to the other side of the step?

• ###### 4. Re: Still baffled by the Tableau Prep Aggregate step

Aggregate is  Quite Similar to LOD. You can have a  look here.

Thanks

Deepak

1 of 1 people found this helpful
• ###### 5. Re: Still baffled by the Tableau Prep Aggregate step

This is really helpful, Deepak. Those obtuse triangles in Prep always throw me for a loop, but this is a good way to think about it!