Narrative-specific functions
These functions are specific to the Narrative platform.NORMALIZE_EMAIL
Normalizes an email address for consistent matching.- Lowercase conversion
- Removal of plus-addressing
- Provider-specific handling (Gmail dot removal, etc.)
NORMALIZE_PHONE
Normalizes a phone number to a standard format.HASH
Generates a hash from one or more values.MD5 / SHA1 / SHA2
Standard cryptographic hash functions.HMAC_SHA256
HMAC using SHA-256.ADDRESS_HASHES
Generates hash variants for address matching.NARRATIVE_ID_ENCODE
Encodes a clear text identifier into a Narrative ID within a specific encoding space. Narrative IDs are per-partner pseudonymous identifiers that enable privacy-safe data collaboration. Syntax:
Returns: string - The encoded Narrative ID
Examples:
The same identifier encoded with different
key_id values produces different Narrative IDs. Always normalize identifiers (lowercase, trim whitespace) before encoding for consistent matching.NARRATIVE_ID_TRANSLATE
Translates a Narrative ID from one partner’s encoding space to another. This enables secure data collaboration by converting identifiers without exposing the underlying clear text values. Syntax:
Returns: string - The translated Narrative ID in the target encoding space
Examples:
UNIVERSE_SAMPLE
Deterministic sampling based on an identifier.DETERMINISTIC_RAND
Generates a deterministic random number from a seed.PARSE_JSON / TRY_PARSE_JSON
Parses a JSON string.OBJECT_REMOVE_NULLS
Returns a struct with null-valued fields removed. On AWS hosted data planes, the function is accepted for cross-platform query compatibility but operates as a no-op.TOKENIZE
Tokenizes text using a specified model.TOKENIZE_SIZE
Returns the token count for text.EMBED_TEXT_768
Generates a 768-dimensional text embedding.COSINE_SIMILARITY
Calculates cosine similarity between two vectors.TEXT_SEARCH
Scores text relevance against a search query.UUID_GENERATE
Generates a random UUID.Related content
Aggregate Functions
GROUP BY computations
SELECT
DELTA tables and budget clauses
All Functions
Browse all function categories
NQL Design Philosophy
Why NQL extends standard SQL

