Skip to Content
Author's profile photo Krishna Reddy Hanmaiahgari

How Classify The Classes based on Percentage in SAP HANA

Degree classification has a long history in our universities. It is widely accepted by students, parents and employers as the measure of academic achievement.

In this blog I am classifying the Student classes based on there percentage. If Student get above 60 percentage then they will get “FIRST CLASS” or If Student get between 60 to 50 percentage then they will get “SECOND CLASS” or If Student get below 50 percentage they will get “THIRD CLASS”.

For Implementing this scenario I took two calculated columns one for calculating Percentage other one for Specifying Class.

Below are the steps to implement “How Classify The Classes based on Percentage in SAP HANA”.

Step 1) Create one Table with the name “STUDENT_DETAILS” in our schema with following structure

Insert Below Values into our Table

Step 2: Create Calculation view in our package with the name “STUDENT_CLASS”

Select STUDENT_DETAILS table in projection and Select the all columns.

Create One calculated column for Calculating Percentage.

Create another calculated column for calculated for class classification.

Use the following logic to classifying the classes.

if(“MARKS_PERCENTAGE”>=60,‘FIRST CLASS’,if(“MARKS_PERCENTAGE”>=50 and “MARKS_PERCENTAGE”<60,‘SECOND CLASS’,if(“MARKS_PERCENTAGE”<50,‘THIRD CLASS’,‘FAIL’)))

Add projection to aggregation and select the calculated columns MARKS_PERCENTAGE and CLASS

Save and Activate the View.

select the data preview.

Output:

Above output we can see the CLASSES Classification in last column.

 

 

 

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.