SapHanaTutorial.Com HOME     Learning-Materials Interview-Q&A Certifications Quiz Online-Courses Forum Jobs Trendz FAQs  
     Explore The World of Hana With Us     
About Us
Contact Us
 Apps
X
HANA App
>>>
Hadoop App
>>>
Tutorial App on SAP HANA
This app is an All-In-One package to provide everything to HANA Lovers.

It contains
1. Courses on SAP HANA - Basics, Modeling and Administration
2. Multiple Quizzes on Overview, Modelling, Architeture, and Administration
3. Most popular articles on SAP HANA
4. Series of Interview questions to brushup your HANA skills
Tutorial App on Hadoop
This app is an All-In-One package to provide everything to Hadoop Lovers.

It contains
1. Courses on Hadoop - Basics and Advanced
2. Multiple Quizzes on Basics, MapReduce and HDFS
3. Most popular articles on Hadoop
4. Series of Interview questions to brushup your skills
Apps
HANA App
Hadoop App
';
Search
Stay Connected
Search Topics
Topic Index
+
-
SAP HANA Modeling
+
-
Spatial Processing
+
-
Predictive Analysis

Run ABC Analysis using HANA PAL - Part 1

In previous articles, we explained: Now this is the time to get your hands dirty and do an analysis using PAL.
We will use ABC Analysis to run our first use case. Let us first understand what ABC Analysis is.

Origin of the ABC Analysis

It all began with Pareto and the 80/20 principle. The inventor Vilfredo Pareto was born in France in 1848, discovered a natural principle which can be applied to almost all fields of science.

In his study he discovered that

“80% of the land in Italy was owned by 20% of the population.”

He also noticed that 80% of his garden peas were being produced by 20% of the pea pods. Through several studies of different phenomena, he concluded that
“In many cases 80% of the consequences stemmed from 20% of the causes.”

ABC Analysis

Today, the 80/20 rule is used to describe when effort and reward is not a linear correlation. The principle evolved into the classic ABC Analysis


What is ABC Analysis?

This algorithm is used to classify objects (such as customers, employees, or products) based on a particular measure (such as revenue or profit).

A is your most important products. The category contains very few, high-profitable products. They alone generate 80 % of your turnover.

B is less important products. This category accounts for approx. 15 % of your turnover.

C is your “long tail” products. They play an insignificant role in terms of income, but account for more than half of your product numbers! All together they generate 5 % of your turnover.

ABC Analysis
Now we will prepare a data and understand the user story for our example.

User Story:

Let us assume that we have a list of Companies and their turn-over.

Company Name
Turnover
Alpine Systems
130,586
Anav Ideon
202,861.70
Anger
31,787
Baleda
31,897.87
Becker Berlin
445,167
Bionic Research Lab
6,660
DelBont Industries
429,842.55
Florida Holiday Company
156,092.55
HEPA Tec
222,850
Janssen
932,672
Laurent
69,368
Meliva
248,578
PC Gym Tec
11,840.42
Panorama Studios
174,380.85
Pateu
179,650
Pear Computing Services
61,114.89
PicoBit
34,181.91
Quimica Madrilenos
302,745
SAP
358,124
Sorali
57,462
TECUM
403,482
Talpa
567,573
Tessile Casa Di Roma
2,051,179
Vente Et Corporation
91,585

We need to apply the ABC Analysis and find our A, B and C categories for these companies.
The result should look like below.
ABC Analysis

Create Table and prepare the data:

Go to your HANA Studio open SQL Console. Copy the below script and execute it. Make sure you have changed <YOUR_SCHEMA> to your actual schema name.

ABC Analysis

SET SCHEMA <YOUR_SCHEMA>;
 
CREATE COLUMN TABLE COMPANIES (
COMPANY_NAME NVARCHAR(100) PRIMARY KEY,
TURNOVER DOUBLE
);
 
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Alpine Systems',130586);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Anav Ideon',202861.7);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Anger',31787);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Baleda',31897.87);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Becker Berlin',445167);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Bionic Research Lab',6660);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('DelBont Industries',429842.55);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Florida Holiday Company',156092.55);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Janssen',932672);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('HEPA Tec',222850);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Laurent',69368);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Meliva',248578);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Panorama Studios',174380.85);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Pateu',179650);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('PC Gym Tec',11840.42);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Pear Computing Services',61114.89);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('PicoBit',34181.91);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Quimica Madrilenos',302745);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('SAP',358124);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Sorali',57462);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Talpa',567573);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('TECUM',403482);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Tessile Casa Di Roma',2051179);
INSERT INTO COMPANIES (COMPANY_NAME, TURNOVER) VALUES ('Vente Et Corporation de Ordinateur',91585);


Assign PAL Roles to your user

Assign below roles to your HANA user.
  • AFL__SYS_AFL_AFLPAL_EXECUTE
  • AFL__SYS_AFL_AFLPAL_EXECUTE_WITH_GRANT_OPTION
  • AFLPM_CREATOR_ERASER_EXECUTE


In the next article, we will generate PAL procedure and run the ABC Analysis.


Support us by sharing this article.



Explore More
Close X
Close X

Leave a Reply

Your email address will not be published. Required fields are marked *

Current day month ye@r *

 © 2017 : saphanatutorial.com, All rights reserved.  Privacy Policy