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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
padmanabhan_ram
Creator II
Creator II

Value replaceable

Hi,

I have a table with Columns:

A     B     C

1     1     1

2     2     2

3     3     3

4     4     4

5     5     5

How can I replace the values 1,2,3,4,5 with 'NA','Bad','Avg','Good','Expert'. So that the table looks like below

A          B              C

NA       NA            NA

Bad      Bad          Bad

Avg       Avg          Avg

Good    Good      Good

Expert   Expert     Expert

Thanks,

Padmanabhan

Labels (1)
1 Solution

Accepted Solutions
nizamsha
Specialist II
Specialist II

u can use apply map

View solution in original post

6 Replies
padmanabhan_ram
Creator II
Creator II
Author

Adding to the above,   The Values are fixed, will never change.

nizamsha
Specialist II
Specialist II

u can use apply map

padmanabhan_ram
Creator II
Creator II
Author

I Have 18 such columns like A, B, C. Will aplly map work.

nizamsha
Specialist II
Specialist II

TableB:

Mapping  LOAD * Inline [

No,Name

1,NA

2,Bad

3,Avg

4,Good

5,Expert

];

TableA:

LOAD * Inline [

A   ,  B   ,  C

1  ,   1  ,   1

2  ,   2 ,    2

3  ,   3,     3

4  ,   4 ,    4

5  ,   5  ,   5

];

TableC:

LOAD ApplyMap('TableB',A) as A1,

ApplyMap('TableB',B) as B1,

ApplyMap('TableB',C) as C1

Resident TableA;

DROP Table TableA;

nizamsha
Specialist II
Specialist II

S it will work lets see is any other giving the best solution .

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

LOAD

Pick(Match(A, 1,2,3,4,5),  'NA','Bad','Avg','Good','Expert') AS A,

Pick(Match(B, 1,2,3,4,5),  'NA','Bad','Avg','Good','Expert') AS B,

Pick(Match(C, 1,2,3,4,5),  'NA','Bad','Avg','Good','Expert') AS C

Inline [

A   ,  B   ,  C

1  ,   1  ,   1

2  ,   2 ,    2

3  ,   3,     3

4  ,   4 ,    4

5  ,   5  ,   5

];

Regards,

Jagan.