Library › Operations AI › Business analysts

Pull weekly KPIs from a narrative report into typed JSON with nulls

  • For Business analysts
  • You practice Asking for a format you can use
  • Time about 5 minutes
  • Level Intermediate

About this exercise

Write a prompt for exactly one code block holding a JSON object with these keys in this order: week, otif, dock_to_stock_minutes, overtime_hours, inventory_accuracy, safety_recordables. week is the string "W12". otif is a fraction (0.94, not 94). dock_to_stock_minutes converts hours to minutes. Other numbers are plain numbers, not strings. Use null for anything the report does not give. No text outside the block.

Common mistakes when you ask AI for this

  • Guessing the missing value. The AI fills in inventory accuracy with a plausible number. Try: Say: "Use null for anything the report does not state."
  • Not converting units. The AI writes 94 and 5.8 as in the report. Try: Say: "otif is a fraction (0.94); convert hours to minutes (5.8 x 60 = 348)."
  • Using last week's figures. The AI picks up 91 or 150 from the comparison. Try: Say: "Use week 12 figures only."
  • Extra text around the code. The AI adds explanations, extra blocks or comments around the output. Try: Say "exactly one code block, nothing else" and cap the rows.

What a strong prompt includes

  • Lists the exact keys
  • Gives the conversions
  • Uses null for missing
  • Asks for one JSON block

Practice this now ↑

Related exercises