You are on page 1of 17

Zakiyatun Surya

Technical Test Business Intelligence Analyst


TABLE OF CONTENTS

01 02
SQL VISUALIZATION AND ANALYSIS
Write SQL queries Create a dashboard (in Tableau)
to display the information visually
to the decision maker
03
MODELLING
Create a fair scoring model for
salesmen and find the most and
least significant variables on
salesman performance
01
SQL
Write SQL queries
CHALLENGE
Get top 3 products with the highest total sales value in October 2020 in each
01 category. Show the category name, product name, and total sales value.
Total Sales Value = Order Value from delivered transaction (trx_state = ‘Delivered’).

SELECT category_name, product_name, sum_order


FROM (
SELECT category.name AS category_name, product.name AS
product_name, SUM(sales_order.order_value) AS sum_order,
RANK() OVER (PARTITION BY category.name ORDER BY product_name ASC) AS rnk
FROM category
INNER JOIN product ON category.id=product.category_id
INNER JOIN sales_order ON product.id = sales_order.product_id
WHERE sales_order.trx_state = 'Delivered' AND sales_order.created_at >= '2020-10-01 00:00:00'
AND sales_order.created_at <= '2020-10-31 00:00:00'
GROUP BY product_name ORDER BY sum_order DESC, category_name ASC) AS a
WHERE rnk <= 3;
CHALLENGE
SELECT t1.category_name, t1.product_name, t1.product_sales_value,
t2.average_sales_value
02 FROM (
SELECT category.name AS category_name, product.name AS product_name,
SUM(sales_order.order_value) AS product_sales_value FROM category
INNER JOIN product ON category.id = product.category_id
INNER JOIN sales_order ON product.id = sales_order.product_id
Get all products with WHERE sales_order.trx_state = 'Delivered' GROUP BY product_name) t1
sales value lower than LEFT JOIN (
average sales value of SELECT category.name AS category_name, product.name AS product_name,
products within the AVG(sales_order.order_value) AS average_sales_value FROM category
INNER JOIN product ON category.id = product.category_id
corresponding category. INNER JOIN sales_order ON product.id = sales_order.product_id
Show category name, WHERE sales_order.trx_state = 'Delivered'
product name, product GROUP BY category_name) t2
sales value, and ON (t1.category_name = t2.category_name)
average sales value in WHERE product_sales_value < average_sales_value
corresponding category. ORDER BY category_name ASC;
CHALLENGE
SELECT t1.category_name, t1.sales_lost,
t1.sales_lost/COALESCE(t2.sum_order) AS sales_lost_rate

03 FROM (
SELECT category.name AS category_name,
SUM(sales_order.order_value) AS sales_lost
FROM category
INNER JOIN product ON category.id = product.category_id
Calculate sales lost and sales lost INNER JOIN sales_order ON product.id = sales_order.product_id
rate of each category, sort by WHERE sales_order.trx_state='Cancelled'
sales lost descending. Show GROUP BY category_name) t1
category name, sales lost, and LEFT JOIN (
SELECT category.name AS category_name,
sales lost rate.
SUM(sales_order.order_value) AS sum_order
Sales lost = Order Value from FROM category
Cancelled Transactions. INNER JOIN product ON category.id = product.category_id
Sales Lost Rate = (Order value from INNER JOIN sales_order ON product.id = sales_order.product_id
cancelled transactions)/(Total GROUP BY category_name) t2
ON (t1.category_name = t2.category_name)
order value from all ORDER BY sales_lost DESC;
transactions)
02
VISUALIZATION AND
ANALYSIS
Create a dashboard (in Tableau) to display the
information visually to the decision maker
Challenge 1
Farah felt that the results of the
visualization were valid for comparing the
three apps. Do you agree with Farah? If you
agree, why? If you disagree, why and show
me a better way to compare the three apps
regardless of the numbers on the graph.

agree, but it is better to add a legend description for


each category to make it easier for users to know the
average duration of use each application
Challenge 2
Create a dashboard (in Tableau) to display the information visually to the
decision maker. Prepare a presentation to present any insights, anomalies, and
a concrete plan for management to commit to in the next quarter with a goal
to persuade management to make a decision based on your suggestions. Make
assumptions whenever required, please make sure you mention the
assumptions in your deck
https://drive.google.com/file/d/1suO-UWQ2oxvp7OaM8wp9yRoCvIAmWl5i/view?usp=sharing
Based on the results of data processing in the
dashboard, the recommendations I can give include:
1. The best-selling category is instant drinks. The
company can recommend the best-selling.
2. Categories with high enough returns are diapers
and sanitary napkins. My recommendation should
be quality control, especially on diapers and
sanitary napkins.
3. Make product bundling for the highest and lowest
sales.
03
MODELLING
Create a fair scoring model for salesmen and find
the most and least significant variables on https://drive.google.com/file/d/1pfgqAOqtam0
salesman performance Lyf4RJ8v1TjxDiHWfd5UA/view?usp=sharing
Challenge 1
calculate the score of
each salesman
raw_data_4['score'] = (raw_data_4['GMV
(in scale)']*.4) + (raw_data_4['Count of
Customer']*.25) + ( raw_data_4['Count of
Customer']*.25) + (raw_data_4['%GMV of
cigarettes']*.1)

Sort the salesmen from the


highest score
raw_data_4.sort_values('score',
ascending=False)
salesmen from the highest score
Challenge 2
Find the most and least significant
variables on salesman performance as
measured by the achievement of GMV
looking for the correlation of 4 variables on salesman performance

import matplotlib.pyplot as plt


import seaborn as sns
plt.figure(figsize=(10,5))
sns.heatmap(scoring_salesman.corr(),
annot=True, cmap='coolwarm')
Plot seaborn

Based on the score, the


variable with the highest
significance value on the
GMV score is the GMV
variable (in score) with a
significant value of 1.0 .
While the variable with the
lowest significance value on
the GMV score is the Count
of Invoice variable with a
significant value of -0.13.

You might also like