gamingdirectional: Create the game background Part 2

Hello and welcome back to part two of this chapter. In this chapter, we will finish up the background rendering process for our new pygame project. If you have missed out the first part of the tutorial then you can read it here. OK let us continue… In part one we have created two new classes, in this part, we will find out how to use them. First of all, you will need to create a tile sheet…

Source

Planet Python

Tableau Class Notes: To Aggregate or Not to Aggregate? Part 2

clean aggregated data in Tableau

As a follow-up to my prior blog post, I wanted to explore an additional use case for aggregation in Tableau: joining together data that might be at different date levels. It’s the same premise—you have two data sources at two levels of detail (e.g. row-level transactions vs. regional goals; employee-level vs. team-level), but the steps to aggregate that data are slightly different.

In this example, we have weekly profit data, as well as daily sales data. Our end goal is to return three columns with our daily sales rolled up to the weekly level so that we can compare it against our profits:

weekly and daily profit data in Tableau

Since one data source is at the weekly level, and one is at the daily level, adding an aggregation will be necessary to return data at the correct level.

When Aggregation is Necessary

A rule of thumb for aggregation: your data sources must be aggregated so that they match the data source with the highest level of aggregation. In our example, we have our data split out by week and by day. We couldn’t reliably break our weekly data down to the daily level since we don’t know what days each profit occurred on, so we should aggregate our daily data to the weekly level.

Once we add an Aggregate step, we need to specify what fields we are grouping by and what we are aggregating:

grouped and aggregated fields in Tableau

Click on the word Group next to your data type icon to change your “Group By” level to “Week Start” so it matches our Weekly target data. If you want to read more about how Tableau treats our different options, check out this video from my colleague, Katie! Next, we can add a Clean step and join our two data sources together on our two date fields to get our final data source:

clean aggregated data in Tableau

Hopefully this clears up any questions you have about how to tackle situations where you might have data at two different date levels. Cleaning it up in Prep before you bring it into Tableau Desktop will make your life infinitely easier by minimizing the need for calculations. Thanks to Kent Sloan for assistance on this blog, and thanks for reading!

The post Tableau Class Notes: To Aggregate or Not to Aggregate? Part 2 appeared first on InterWorks.

InterWorks

WEBINAR: Transitioning Your Tableau Platform to the Cloud – Part 1

Hosting your analytic platform in the cloud is the next stage of data analytics, and now is the time to migrate that data. InterWorks Solutions Architect Mat Hughes and Data Practice Lead, Brian Bickell, lead a webinar on how deployment can advance your business and enhance your data practice, including the benefits of more flexible architecture and greater speed to value.

Download the webinar to learn more about how Tableau is a perfect fit for cloud migration and see firsthand the power of Snowflake, the premier data warehouse built for the cloud.

Download Now

Fill out the form below and get instant access to the recording.

  • I understand that InterWorks will use the data provided for the purpose of communication and the administration of my request. InterWorks will never disclose or sell any personal data except where required to do so by law. Finally, I understand that future communications related topics and events may be sent from InterWorks, but I can opt-out at any time.
  • This field is for validation purposes and should be left unchanged.

The post WEBINAR: Transitioning Your Tableau Platform to the Cloud – Part 1 appeared first on InterWorks.

InterWorks