Leverages Snowflake Dynamic Scripting To Provide Import Statistics For Specified Companies
This Snowflake stored procedure dynamically constructs and executes a SQL query to aggregate import data ', "from multiple tables in the XPRESSFEED schema matching the pattern '%PANJIVA%IMPORT%'. It ensures a consistent set of columns across tables, handles missing columns, and aggregates data by ultimate parent company, region, and date range. The query joins with reference tables to filter by company IDs and applies region-specific shipment counting logic.The query adapts joins based on shppanjivaid or conpanjivaid availability, aggregates metrics like shipment counts and values by company and region, and maps regions to country names. Optimized with metadata caching, it delivers robust, error-handled results for import analysis. Tags: Snowflake Scripting, Snowflake Automation, Dynamic Column Handling, Metadata Caching, Cursor Operations, Dynamic SQL
アドオン 2025/05/14
- SourceMarket Intelligence
- Data Packages Required