dst-join-analysis

Generate executable SQL join patterns for multi-table DST analysis in DuckDB.

2|1|Updated Oct 30, 2025
One-click install
npx skills add https://github.com/mikkelkrogsholm/dst-skills --skill dst-join-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dst-join-analysis
Source: https://github.com/mikkelkrogsholm/dst-skills/tree/main/.claude/skills/dst-join-analysis
Command: npx skills add https://github.com/mikkelkrogsholm/dst-skills --skill dst-join-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

DST data often lives in multiple tables with shared dimensions; joining them enables richer analytics and cross-indicator insights.

Core Features & Use Cases

  • Join patterns: Time-series joins, regional comparisons, multi-indicator analyses.
  • Data type handling: Convert text codes to numeric values for calculations.
  • Performance tips: Efficient filtering and join ordering for DuckDB.

Quick Start

SELECT a.tid, a.område, a.indhold AS value_a, b.indhold AS value_b FROM dst_folk1a a INNER JOIN dst_folkb1 b ON a.område = b.område AND a.tid = b.tid

Frequently Asked Questions about dst-join-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I join multiple DST tables in DuckDB for comparative analysis?

SQL joins combine DST tables on shared dimensions like time and region. Use INNER JOIN with matching ON clauses for tid and område to align time-series and regional data across tables, enabling cross-indicator comparisons and trend analysis.

What's the best way to handle text-to-numeric conversion when joining DST data?

Cast TEXT columns to numeric types before aggregations or calculations in your JOIN query. DST codes stored as text require explicit conversion to support arithmetic operations and proper filtering across joined tables.

Can I perform time-series joins on DST tables with different update frequencies?

Yes, time-series joins work across DST tables with mismatched frequencies by filtering on tid (time identifier) and região. Use LEFT or INNER JOIN based on whether you need all time periods or only matching overlaps.

How do I optimize multi-table DST joins for query performance in DuckDB?

Filter early on dimensions like tid and område before joining, order joins to filter largest tables first, and index frequently-joined columns. DuckDB executes filtered subqueries more efficiently than full-table joins.

What should I do when DST join results have missing values across indicators?

Filter out NULL results using WHERE clauses after joining, or use LEFT JOIN with COALESCE to retain partial matches. Missing values often indicate data gaps or dimensional misalignment in the source tables.