Page cover image

Data Modeling

Model and clean your data for a solid foundation

If you've already optimized your data for business intelligence, you're probably good to go. However, if you're just embarking on your data analytics journey, you may need to structure your data in a way that makes it more suitable for analysis. The good news is you can accomplish all of this in Patterns. You can create data transformations via chatting with the AI, or via Dev Mode where you can write SQL, Python, and orchestrate data flow.

Here are a few examples of the things you might need to do:

  1. Data Cleaning: Make sure your raw data is devoid of errors, duplicates, and irrelevant information to uphold data integrity and relevance. For example, you might need to remove redundant entries of users who have clicked on an advertisement multiple times in quick succession.

  2. Standardization and Schema Consistency: Unify data from different sources into a standardized format, naming convention, and schema to streamline integration and analysis. For instance, if Facebook's marketing data labels a column as "User ID," and Google Ads calls it "UserID," you'll probably want to lowercase both and standardize for easier querying.

  3. Data Integration and Aggregation: Merge data from various sources and condense it to your desired level of granularity. For example, you could integrate marketing metrics with CRM data using common identifiers to provide a comprehensive view of customer interaction. Another example would be consolidating daily click-through rates to offer monthly or quarterly performance overviews.

Chat based data prep

If you know what you want to do in natural language, describe it, then you can save the SQL and resulting Table, and then expose this to the AI. Let's explore how:

  1. Describe the operation you want:

  1. Save the Analysis to add to your library and DAG then click the Edit button which will open the entire analysis in the sidebar.

  2. Navigate to the Data tab and toggle on Include Table in Analyst.

Writing SQL Manually

For any Analysis, you can manually edit the SQL by clicking on the Edit button next to the Analysis:

After clicking Edit, the query will open in an IDE in the sidebar:

Date modeling in Dev Mode

Alternatively, you can navigate to Dev Mode to visualize data lineage, and manually add Python or SQL nodes to your DAG. See more in DAG, Infra, & Python to explore how to operate in Dev Mode.

Last updated