Skip to main content
This guide walks through the practical steps for working with Narrative IDs—encoding your identifiers and translating them for partner collaboration.

Prerequisites

Before working with Narrative IDs, ensure you have:
  • Access to the Narrative platform with appropriate permissions
  • An encoding key ID for your organization’s encoding space
  • Partner encoding key IDs if you need to translate for collaboration

Encoding identifiers

Encoding converts a clear text identifier (such as an email or hashed email) into a Narrative ID within your organization’s encoding space.

When to encode

Encode identifiers when you want to:
  • Share data with partners without exposing raw identifiers
  • Create privacy-safe join keys for cross-organization matching
  • Prepare data for collaboration workflows

Using NARRATIVE_ID_ENCODE

The NARRATIVE_ID_ENCODE function creates a Narrative ID from a clear text identifier. Syntax:
Parameters: Example: Encoding email addresses
Example: Encoding already-hashed identifiers If your data already contains hashed emails (SHA-256), you can still encode them:
Always normalize identifiers before encoding. For emails, use LOWER(TRIM(email)) to ensure consistent matching.

Creating a dataset with Narrative IDs

To prepare a dataset for sharing, encode the identifiers during a materialized view creation:

Translating between partners

Translation converts a Narrative ID from one partner’s encoding space to another, enabling cross-organization matching without exposing the underlying identifiers.

When to translate

Translate Narrative IDs when you need to:
  • Share data with a specific partner for matching
  • Query across datasets from different partners
  • Enable a partner to join your data with their own

Using NARRATIVE_ID_TRANSLATE

The NARRATIVE_ID_TRANSLATE function converts a Narrative ID from its current encoding space to a target partner’s encoding space. Syntax:
Parameters: Example: Translating for a partner

Partner collaboration workflow

Here’s a typical workflow for sharing data with a partner:
1

Encode your identifiers

Create Narrative IDs in your encoding space:
2

Translate for your partner

Convert your Narrative IDs to the partner’s encoding space:
3

Share the translated data

The partner receives data with Narrative IDs in their encoding space. They can now join against their own data using their Narrative IDs.

Joining across partner datasets

When querying data that spans multiple partners, use translation in the join condition:

Working with match tables

Match tables are pre-generated lookup tables that pair Narrative IDs with clear text identifiers, enabling offline workflows.

What match tables provide

  • A static mapping between your clear text identifiers and their Narrative IDs
  • The ability to work with Narrative IDs outside the Narrative platform
  • Faster lookups for high-volume processing

Generating a match table

Create a match table by selecting both the raw identifier and its encoded Narrative ID:

Using match tables

Once generated, you can export the match table for use in external systems:
Match tables contain mappings between clear text identifiers and Narrative IDs. Handle them with the same security precautions as any sensitive data.

Best practices

Normalization before encoding

Always normalize identifiers before encoding to ensure consistent matching:

Performance considerations

  • Encode once, translate as needed: Encode your raw identifiers once and store the Narrative IDs. Translate only when preparing data for a specific partner
  • Use materialized views: For frequently accessed data, encode identifiers in a materialized view rather than at query time
  • Batch translations: When sharing with multiple partners, consider creating partner-specific views

Encoding vs. hashing


Troubleshooting


Narrative ID Concepts

Understand how Narrative ID works

NQL Functions Reference

Complete function syntax and parameters

Data Pseudonymization

Hashing fundamentals for privacy