Kusto Detective Agency Season 2 —Case #1 Badge

Walk Through Guide for Kusto Detective Agency Season 2, Case #1 Solution

Aviv Yaniv
Courisity is a Drug
2 min readMay 28, 2023

--

Cases Solutions: 0 1 2 3 4 5 6 7 8 9 10

Get ready to save money on your bills! 💸

The first case riddle is:

The key takeaways from the riddle:

  1. The monthly bills are calculated for each house, based on water and electricity consumption
  2. The usage pattern has not changed, yet total bills have risen up
  3. We are asked to find the best approximation of the right amount to bill

⚠SPOILER ALERT — THE SOLUTION DESCRIBED BELOW⚠

Note: Solution is mine, and non-official

So let’s delve into the data, by leveraging the | take 10, to see some rows.

The Consumption table has; Timestamp, HouseholdId, MeterType, Consumed.

Let’s see Costs table as well:

Nothing exciting, yet 😉

Metrics reporting is error-prone:

Sometimes the same metric is sent again, as it’s better to send same record than to lose it, so let’s hunt duplicates:

Voilà! First luck🌟

Moreover, some telemetry values are faulty.

Let’s see what the value ranges there are:

We definitely don’t want such negativity in our life!

Let’s avoid duplicate rows, by using the distinct operator, and avoid negative values:

We saved the day! …or at least some money for Digitown citizens 🦸‍♂🦸‍♀

Enjoyed this article? Feel free to long-press the 👏 button below 😀

Click for Next Case Solution ➡

Click for Previous Case Solution ⬅

Cases Solutions: 0 1 2 3 4 5 6 7 8 9 10

--

--

Aviv Yaniv
Courisity is a Drug

Senior Software Development Engineer 🖥️ Economist 📈 Beer Brewer 🍻 Photographer 📷 ~ “Curiosity is my drug”