Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Club Values in a column

HI All,

I Have this: Column Name= Grade

Grade:

AM

Articles

Contract

CXO

Director

DM

Executive

M1

M2

Manager

Partner

Senior Exe

SM

Staff

Trainee

I need this :

CXO & Director as Director

M1& M2 & Manager as Manager

AM as Assistant Manager

DM as Deputy Manager

SM as Senior Manager

Senior Exe as Senior Executive

Executive

Staff

( Remove this values: Articles, Contract, Partner, Trainee)

Thanks,

Krishna

10 Replies
robert_mika
Master III
Master III

Kushal_Chawda

Try mapping load & apply map

Map_Grade:

LOAD

Name, Capitalize(trim(Grade) as Grade;

LOAD  inline [

Grade, Name

AM, Assistant Manager

Articles,

Contract,

CXO,Director

Director,Director

DM,Deputy Manager

Executive,

M1,Manager

M2,Manager

Manager,Manager

Partner,

Senior Exe,Senior Executive

SM,

Staff,

Trainee, ];



Actualdata:

LOAD *,

            applymap('Map_Grade',Grade,Grade) as GRADE

LOAD *,

            capitalize(trim(Grade)) as Grade

FROM Table;

Chanty4u
MVP
MVP

try this

Sample:

LOAD * INLINE [

    AM

    Articles

    Contract

    CXO

    Director

    DM

    Executive

    M1

    M2

    Manager

    Partner

    Senior Exe

    SM

    Staff

    Trainee

];

rrrr:

load *,

Director &'_'& CXO as Director,

M1 &'_'& M2 &'_'& Manager as Manager,

AM as [Assistant Manager],

DM as [Deputy Manager],

SM as [Senior Manager],

[Senior Exe] as [Senior Executive],

Executive,

Staff

Resident Sample;

sunny_talwar

May be like this:

LOAD

If(WildMatch(Grade, 'CXO', 'Director'), 'Director',

If(WildMatch(Grade, 'M1', 'M2', 'Manager'), 'Manager',

If(WildMatch(Grade, 'AM'), 'Assistant Manager',

If(WildMatch(Grade, 'DM'), 'Deputy Manager'

If(WildMatch(Grade, 'SM'), 'Senior Manager',

If(WildMatch(Grade, 'Senior Exe'), 'Senior Executive', Grade)))))) as Grade


WHERE not Match(Grade, 'Articles', 'Contract', 'Partner', 'Trainee');

Anonymous
Not applicable
Author

Hi,

The table having 20 columns including Grade.

I need some values club and some values remove from Grade column.

I need to create a list box Grade in Ui as Filter.

Pls help me.

Thanks,

Krishna

Kushal_Chawda

Create the field in script

LOAD

If(Match(Grade, 'CXO', 'Director'), 'Director',

If(Match(Grade, 'M1', 'M2', 'Manager'), 'Manager',

If(Match(Grade, 'AM'), 'Assistant Manager',

If(Match(Grade, 'DM'), 'Deputy Manager'

If(Match(Grade, 'SM'), 'Senior Manager',

If(Match(Grade, 'Senior Exe'), 'Senior Executive',

if(Match(Grade, 'Articles', 'Contract', 'Partner', 'Trainee'),null()))))))) as Grade


then use this field in listbox


sunny_talwar

Suresh did you test this before posting it here? I am pretty sure this would error out because of the way you are calling M1 and other fields from Sample table which don't even exist.

Try testing it out before you post a response

Best,

Sunny

Chanty4u
MVP
MVP

No sunny.........From next time onwards i will do the same

sunny_talwar

Don't feel bad, I am just trying to help make this community a better place. I don't want you or anyone else to read a code and think, is this right?

Thanks for understanding bro