Library › Data AI › Operations and supply chain
Flag unusual days in a daily orders list as a CSV block
- For Operations and supply chain
- You practice Showing an example of what you want
- Time about 5 minutes
- Level Intermediate
About this exercise
Your ops team wants unusual days flagged from a daily orders list. Write one CSV block (one code block) with the header day,orders,flag and one row per day, in the same order. Flag is CHECK if orders are below 100 or above 300, otherwise OK. At most 12 words outside the code.
Common mistakes when you ask AI for this
- Excusing explained days. The AI marks the flash sale day OK because it has a reason. Try: Add: "Flag every day outside the range even if there is an explanation."
- Fuzzy flags. The AI uses words like 'high', 'low' or 'maybe'. Try: Add: "Use only OK and CHECK; CHECK if below 100 or above 300."
- Wrong CSV shape. The AI adds columns for notes or sorts the rows. Try: Add: "Header day,orders,flag, then 8 rows in the same order."
- Leaving the format to chance. The AI picks its own length and layout unless told the exact shape. Try: Add: "Put the code in exactly 1 code block. Keep the writing outside the code under 12 words."
What a strong prompt includes
- Gives the thresholds
- Rules on explained days
- Limits the flag words
- Names the header
- Keeps the order
Related exercises
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add mail-merge greetings for couples and missing names (Coding AI · Nonprofit staff)
- Annualize recurring revenue without the one-time fee (Data AI · Finance and accounting)
- Answer a new analyst's table questions using only the data guide (Data AI · Business analysts)
- Answer a revenue terms FAQ for new hires using one deal (Data AI · Finance and accounting)