Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Classification based on calculated value

Hi all

I have the following script to classify airports based on a calculated index . However, Qlikview keeps detecting an error.

Can anyone help?

My intended outcome should be something like this:

Airport     Index     Grade

ABC         1.5          C

DEF           2           B

HIJ           2.5          A

...

+++++++++++++++++++++++++++++++++++++++++++++

//CALCULATION OF DEPARTURE AIRPORT INDEX 

NoConcatenate 

DEP_AIRPORT_INDEX: 

LOAD *, 

(DEP_CARRIER/MAX_DEP_CARRIER)+(DEP_FLIGHTS/MAX_DEP_FLIGHTS)+(DEP_DIST_GROUP/MAX_DEP_DIST_GROUP)+(DEP_AIRPORT_COUNT/MAX_DEP_AIRPORT_COUNT) as DEP_AIRPORT_INDEX 

Resident DEP_AIRPORT; //THIS IS A TABLE OF ALL THE AIRPORTS AND ITS RESPECTIVE ATTRIBUTES

ASSIGNING GRADES TO THE AIRPORTS

NoConcatenate

DEP_AIRPORT_GRADE:

LOAD*,

if (DEP_AIRPORT_INDEX<=fractile(DEP_AIRPORT_INDEX,0.25),'D',

if (fractile(DEP_AIRPORT_INDEX,0.25)<DEP_AIRPORT_INDEX<=fractile(DEP_AIRPORT_INDEX,0.5),'C',

if (fractile(DEP_AIRPORT_INDEX,0.5)<DEP_AIRPORT_INDEX<=fractile(DEP_AIRPORT_INDEX,0.75),'B',

if (fractile(DEP_AIRPORT_INDEX,0.75)<DEP_AIRPORT_INDEX,'A', 'NULL')))) as GRADE_DEP_AIRPORT

FROM DEP_AIRPORT;

1 Reply
swuehl
Not applicable

Re: Classification based on calculated value