When to use multiple transformations per activity
It can be helpful to define multiple transformations to generate a single activity. Learn how it's done.
Great times to use multiple transformations per activity
Business logic has changed over time
We often update our business logic and have to union two queries (with different logic) together so we can have all the data in one table. Don't do this - just create two transformations, one for each set of logic.
To manage backfills
We often have to manually backfill of data and instead of incorporating that into a single query. In these cases you can have it be 2 separate transformations.
The source of truth has changed
We often see customers moving from Hubspot to Salesforce. Instead of writing complex queries, just define each transformation separately and deprecate the old one by adding a time filter.
....
where ts < '2019-01-01' -- day of migration
Dedicated activities for identity resolution
This is where Narrator can make your life so much better. Instead of trying to do identity resolution with a single transformation (and a monster mapping table), you can break it up into multiple queries.
Ex. Write a separate transformation for:
- when a user gets identified
- when users click in an email
- when users are redirected from Calendly
- when users login
These all can be the same activity (ie. identified_user
) and Narrator will handle the mapping between each source.
Read more about dedicated activities for identity resolution
Data is generated from multiple systems
It is common that you have multiple services for a customer behavior (ie. lead creation can happen in Pardot and Salesforce). Simply write separate transformations for each and Narrator will seamlessly combine the activities.
Signs that you should use multiple transformations
You have a UNION in your SQL query š
š¼āāļø
In pretty much all cases it is better to split it up and separate transformations
Your query is getting long š¤¦š¼āāļø
This means something is probably wrong. Activity definitions should be simple. Sometimes it can help to break it up to smaller, simpler transformations to generate the same activity.
Still have questions?
Our data team is here to help! Here are a couple ways to get in touch...
š¬ Chat us from within Narrator
š Email us at [email protected]
š Or schedule a 15 minute meeting with our data team