Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
shakeeb_mohammed
Contributor III
Contributor III

Calculation - Rating a Percentage as a Score

Hi Guys,

I'm hoping someone can help me with a calculation in my script.

My data has percentages varying from 40% - 100% which is a score for an individual please see below.

DriverGreen Band %
Driver 1

90.04%

Driver 280.04%
Driver 3

64.99%

I'm trying to insert a calculation that will give a rating to drivers

Example

  • 40 - 50 % = G
  • 50- 60% = E
  • 60-70% = D
  • 70-80% =C
  • 80-90% =B
  • 90-100% = A

My aim is to then add a field that will give a driver their score and report summing the amount of drivers in category A,B,C etc.

I'm using QlikSense - Thank you in advance!

4 Replies
adityaakshaya
Creator III
Creator III

Hi Shakeeb,

As per my understanding, Intervalmatch can help you to achieve this.

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ScriptPrefixes...

Regards,

Akshaya

sunny_talwar

Look here

Buckets

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Can I suggest you use MAPPING table and APPLYMAP(). See below snippets

Map_DriversGreenBand:

MAPPING LOAD

       Start + ITERNO()-1                AS MapFrom,

       Banding                                  AS MapTo

INLINE [

Start,        End,   Banding

40,            50,      G

51,            60,      E

61,            70,      D

71,            80,      C

81,           90,       B

91,           100,      A

]

WHILE Start+ ITERNO()-1 <= End;

// then in your table where the driver's grade is

table:

LOAD

fld1,

fld2,

APPLYMAP('Map_DriversGreenBand',GreenBand%,NULL())          AS      [WhateverFieldName]

RESIDENT tmpTableOrWhatever;

Let me know if this helps

shakeeb_mohammed
Contributor III
Contributor III
Author

Hi Thanks for the reply and apologies for the delayed response.

I have successfully loaded the script but it shows no Data.

the only thing  I didn't do is use the Resident script. - could you specify what table i will need to Resident please.