To help you approach these data analysis tasks, I'll provide a detailed explanation and guidance on how to solve each question based on the provided dataset support_questions. Below is a step-by-step guide for each task:
Задание 1: Тикеты, ожидающие обработки (10 баллов)
Задание:
Calculate the number of tickets currently waiting to be processed by an agent. Use the status field:
1 — ticket has been processed,
- Any other value — ticket requires processing.
If at the same moment there are multiple logs with different statuses for the same ticket, ignore the rows with status = 1.
Подход к решению:
- Filter out all records where
status = 1 if there's another record at the same timestamp for the same question_id with a different status.
- Identify the latest status for each ticket (
question_id), considering only the most recent record per ticket.
- Count the number of tickets where the latest status is not
1.
Шаги:
- Group the data by
question_id.
- For each group, sort by
event_time (assuming there is a timestamp field) in descending order.
- Select the latest record per
question_id.
- Filter out tickets where
status = 1.
- Count the remaining tickets.
Задание 2: Удалённые сообщения (5 баллов)
Задание:
Determine who deletes messages more often and in what quantity. Calculate how many messages were deleted by employees and how many by users. Choose the group that deletes messages more frequently. In the answer, provide a single number — the number of messages deleted by the chosen group.
Подход к решению:
- Identify deletion events in the data. Look for events indicating message deletion.
- Differentiate between deletions made by employees and users, possibly using the
user_type field.
- Count the number of deletions for each group.
- Compare the counts and determine which group deletes messages more often.
- Provide the higher count as the answer.
Шаги:
- Filter records where
event_type corresponds to message deletions.
- Group by
user_type (assuming 'agent' for employees and 'user' for customers).
- Count the number of deletions per group.
- Compare counts and select the higher one.
Задание 3: Повторные вопросы после закрытия по причине «троллинг» (5 баллов)
Задание:
Determine the number of tickets where, after the event event_type = 'troll_closed', the user asked a new question (reply).
Подход к решению:
- Find tickets where an event
event_type = 'troll_closed' occurred.
- For these tickets, check if there is a subsequent event where
event_type = 'reply' initiated by the same user.
- Count the number of such tickets.
Шаги:
- Filter tickets with
event_type = 'troll_closed'.
- For each of these tickets, check for subsequent
reply events.
- Ensure that the
reply comes after the troll_closed event (by comparing timestamps).
- Count the unique
question_ids that meet the criteria.
Задание 4: Анализ тегов тикетов (10 баллов)
Задание:
Count the number of tickets by tags, where a tag is defined as event_subtype LIKE 'tag_%'. Consider only the last tag in each ticket (1 ticket — 1 tag). In the answer, provide the most popular tag.
Подход к решению:
- Identify tag events where
event_subtype matches tag_%.
- For each ticket, select the last tag event based on the timestamp.
- Count the occurrences of each tag across all tickets.
- Determine the most popular tag.
Шаги:
- Filter events where
event_subtype LIKE 'tag_%'.
- Group by
question_id and select the last event_subtype (tag) per ticket.
- Aggregate the counts of each tag.
- Identify the tag with the highest count.
Задание 5: Тег, который чаще всего ставят агенты (5 баллов)
Задание:
Output the tag (event_subtype) that agents most frequently assign to tickets. Consider only events with event_type = 'tag_set_manually'.
Подход к решению:
- Filter events where
event_type = 'tag_set_manually'.
- Assuming agents are identified by
user_type = 'agent' (if applicable).
- Count the frequency of each
event_subtype (tag) set by agents.
- Determine the most frequently assigned tag.
Шаги:
- Filter records with
event_type = 'tag_set_manually'.
- Optionally, confirm that these events are performed by agents.
- Group by
event_subtype and count occurrences.
- Find the tag with the maximum count.
Задание 6: Изменение категории тикета со статусом 0 (5 баллов)
Задание:
Output the ticket number (question_id) where there is a record event_type = 'set_category' when the ticket's status was 0 at the time of the record.
Подход к решению:
- Identify events where
event_type = 'set_category'.
- Check the status of the ticket at the time of this event.
- Select tickets where the status was
0 during the set_category event.
Шаги:
- Filter records with
event_type = 'set_category'.
- For these records, check if
status = 0.
- Output the
question_id of tickets meeting these criteria.
Задание 7: Расчет UWT (15 баллов)
Задание:
Calculate the User Waiting Time (UWT) – the average time users wait for an agent's response. UWT is calculated based on chains of interactions: "user's question" -> "agent's response". Provide the average time in seconds with a precision of two decimal places.
Примечания:
- Consider
event_type = 'agent_reply' as agent responses.
- Consider
event_type = 'reply' as user questions.
- If multiple user questions are sent consecutively, consider the earliest one.
- If multiple agent responses are sent consecutively, consider the earliest one.
- Exclude deleted questions and answers.
Подход к решению:
- Filter out deleted messages.
- Sequence events per
question_id chronologically.
- Identify pairs where a user's question is followed by an agent's reply.
- Calculate the time difference between the user's question and the agent's reply.
- Compute the average of these time differences.
Шаги:
- Exclude events marked as deleted.
- For each ticket, sort events by time.
- Find events where
event_type = 'reply' (user's question).
- From these, identify the next
event_type = 'agent_reply'.
- Calculate the time difference between these events.
- Collect all such time differences and compute the mean.
Задание 8: Расчёт SL (15 баллов)
Задание:
Calculate the Service Level (SL) – the percentage of responses provided within the target time (15 minutes). Use the same interaction chains as in UWT. Provide the value with a precision of two decimal places.
SL Calculation:
- ( SL = \left( \frac{\text{Number of chains with UWT ≤ 15 minutes}}{\text{Total number of chains}} \right) \times 100% )
Примечания:
- Use the same considerations as in UWT for messages and deletions.
Подход к решению:
- Use the time differences calculated in UWT.
- Count the number of chains where UWT ≤ 15 minutes (900 seconds).
- Calculate SL using the provided formula.
Шаги:
- From the UWT calculations, identify time differences ≤ 900 seconds.
- Count the total number of valid chains.
- Apply the SL formula.
- Provide the result with two decimal places.
Задание 9: Определение скорости ответа сотрудников (10 баллов)
Задание:
Identify which group of employees (based on user_type) provides the fastest responses to user questions. Calculate the average response time for each group and determine the group with the lowest average response time.
Подход к решению:
- Identify agent responses (
event_type = 'agent_reply').
- Associate each response with the preceding user's question (
event_type = 'reply').
- Calculate response times for each agent, grouped by
user_type.
- Compute the average response time per
user_type.
- Identify the
user_type with the lowest average response time.
Шаги:
- Filter agent replies and user replies.
- For each agent reply, find the preceding user reply.
- Calculate the time differences.
- Group these time differences by
user_type of the agent.
- Compute the mean response time for each
user_type.
- Determine which group has the smallest mean.
Задание 10: Время до закрытия тикета (10 баллов)
Задание:
Calculate the average time from the last action in a ticket to its closure due to timeout (event_type = 'closed_by_time'). Use only actions that occurred before the closed_by_time event. If a ticket has multiple such events, use the last one. Provide the average number of days with a precision of two decimal places.
Подход к решению:
- Identify tickets with
event_type = 'closed_by_time'.
- For each ticket, find the last action before the
closed_by_time event.
- Calculate the time difference between this action and the
closed_by_time event.
- Convert the time difference into days.
- Compute the average of these time differences.
Шаги:
- For tickets with
closed_by_time, sort events by time.
- Exclude any events after
closed_by_time.
- Identify the last event before
closed_by_time.
- Calculate the time difference.
- Aggregate these differences and compute the mean in days.
Задание 11: Время между назначением и сбросом агента (10 баллов)
Задание:
Calculate the average time from assigning an agent (event_type = 'set_agent') to dropping the agent (event_type = 'drop_agent'). Provide the average time in seconds with a precision of two decimal places.
Примечания:
- Consider only the nearest events to each other.
- If there are multiple
set_agent and/or drop_agent events in a row, use the last set_agent and the first drop_agent.
- Exclude drops initiated by users.
Подход к решению:
- Filter events for
set_agent and drop_agent.
- Within each ticket, pair the appropriate
set_agent with the subsequent drop_agent.
- Exclude any
drop_agent events initiated by users (check user_type or relevant fields).
- Calculate the time differences between these paired events.
- Compute the average time in seconds.
Шаги:
- For each ticket, identify sequences of
set_agent followed by drop_agent.
- Ensure that the
drop_agent is not user-initiated.
- Handle multiple consecutive
set_agent events by taking the last one before drop_agent.
- Handle multiple consecutive
drop_agent events by taking the first one after set_agent.
- Calculate time differences and compute the mean.
Final Submission Format:
After performing the calculations as per the above guidance, you should prepare a text file with the answers. The file should contain one line per question you have solved, with the question number and your calculated answer separated by a comma. For example:
1,Answer_for_question_1
2,Answer_for_question_2
...
Make sure to replace Answer_for_question_X with the actual numerical or textual answers you've computed based on your data analysis.
Note: Since I do not have access to the actual data in support_questions, I cannot provide specific numerical answers. However, following the approaches outlined above will enable you to compute the necessary values for each question using SQL queries, Pandas, or any other data analysis tool you prefer.