✓ Prompt copied to clipboard!
① Ctrl+V to paste the prompt in the chat
② Type the brand or product name and press Enter
③ Copy the UPC list and paste it in Add UPCs manually (Hero or Halo)
Search with:
📚 PD Library ↗
🌙
Dark
Hero / Halo Mode
?
Hero / Halo ModeInclusive: Hero y Halo pueden compartir items → HALO + intersección + remainders (spec del equipo).
Exclusive: Hero ∩ Halo = ∅. Adds HALO column.
Total Read: No CASE WHEN, filter only in WHERE.
Snowflake Table
?
Snowflake TableSelect the source table for your query. You can edit tables.js to add/remove tables without touching this file.
▼
Retailers — optional
WHERE filter
?
Retailer FiltersFilter receipts by specific retailers. Select parent companies (e.g. Kroger) or specific banners (e.g. Walmart). Leave empty to include all retailers.
▼
Brand Filter — optional
?
Brand FilterFilter by CAPTURE_BRAND or BARCODE_BRAND fields. Edit the pattern (e.g. 'LYSOL','LYSOL %') to match exactly. NVL line is added automatically.
▼
Hero UPCs
?
Hero UPCsHero = your target product. Gets CASE WHEN = 1 in SELECT. Paste the UPC list (from Search UPCs or your own) in "Add UPCs manually". You can have multiple Hero groups (e.g. HERO_WALMART, HERO_SAMS).
▼
Halo UPCs
WHERE only
?
Halo UPCsHalo = the full brand context. Only appears in the WHERE clause. Hero UPCs automatically excluded from Halo in the query.
▼
GEO Case — optional
?
GEO CaseGenera una columna aparte CASE WHEN … END AS GEO. No toca el WHERE ni el REMAINDER.

Estado completo: todo el estado, sin filtro de ciudad (STATE_SHORT/STATE_NAME).
Mercado DMA: solo ese mercado — ciudades + DMA_CODE.
▼
Generated SQL
Add filters and/or UPCs to see the query...
SELECT FROM ··· WHERE ···
Ready to generate
Add retailers, brands, or UPCs
to build your Snowflake query.
Llena un caso real chico para ver cómo funciona
¿Ya existe un estudio parecido? Busca el query entregado en
📚 PD Library y reutilízalo