Status x Audience Cross-Tabulation with Marginal Totals
Loading workflow…
Workflow Description
A fully local workflow that builds a two-dimensional cross-tab counting occurrences for every (Status, Audience) pair from a JSON array, computing row totals, column totals, the grand total, and a count of skipped invalid items, then routes pairs above a zero-count threshold to a separate branch and merges both branches into one output with no external calls or credentials.
How it works
- 1.Run the manual trigger; a Code node emits 10 fictional items (9 valid + 1 invalid).
- 2.The matrix builder cleans values, counts each pairing, computes marginals and grand total, skipping incomplete items.
- 3.A Set node adds pair_label while keeping all fields.
- 4.An IF node separates pairs with count > 0 from zero-count pairs.
- 5.Each branch enters an append Merge on its own input, then a no-op endpoint.
Use cases
- Report sent/failed/queued message counts per audience segment
- Any cross-tab aggregation of two configurable categorical fields
- Spot segments that received zero of a given status via the zero branch
Requirements
- No credentials; everything runs locally
- To change the two fields edit STATUS_FIELD and AUDIENCE_FIELD in the matrix Code node
- To use real data remove the generator node and connect your source
Setup and testing in n8n
- Import the JSON into n8n and execute from the manual trigger
- Verify 6 output pairs whose counts sum to 9, matching valid input items
- Verify the one zero pair (Failed × Individuals) arrives via merge input 1
- Try empty or field-missing input to see edge handling
Service Value
Ready-made workflow template for automation delivery and service execution.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (9)
Manual Trigger
Manual Trigger
Generate Sample Messages
Code
Build Cross-Tab Matrix
Code
Format Pair Label
Set
Count Above Zero?
If
Active Pairs Path
No Op
Zero Count Path
No Op
Append All Branches
Merge
Final Output
No Op
Stage 1 - Sample Data
Sticky Note
Stage 2 - Cross-Tab
Sticky Note
Stage 3 - Routing
Sticky Note
Fresh workflows, straight to your inbox
Get newly published DROPIDEA workflows, a clear overview of what they do, and a link to explore them.
- New workflows
- Clear overviews
- Setup guides