Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
rathnam_qv
Creator
Creator

script


Hi all,

i have one field type=1,2,3,4,9.....instead numbers i want to display Names for that Numbers..

how it can be done....help me

Thanks in advance!!!

Smiley

1 Solution

Accepted Solutions
Not applicable

Hi,

I think, we can solve this by using PICK and MATCH functions.

We could do this in two ways, either Script or Calculated dimension. See the attachment.

PICK(Match(MF_INCL, 1,2,3,4,5,6,7,8,9), 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine')

View solution in original post

9 Replies
sushil353
Master II
Master II

Hi,

Please explain your issue with an example.

Otherwise you can use mapping table to replace the number with name or use dual function.

HTH

Sushil

rathnam_qv
Creator
Creator
Author

HI Sushil,

can u send me the dual function script

sujeetsingh
Master III
Master III

Hi you can do it in script as well as UI

..write

if(FieldName='1','Name1',

if(FieldName='2','Name2',

......))

sushil353
Master II
Master II

Tab1:

LOAD * Inline

[

Name

One

Two

Three

Four

Five

Six

Seven

Eight

Nine

];

Table:

LOAD dual(Name,RowNo()) as name_no,

rowno() as no

Resident Tab1;

DROP Table Tab1;

rathnam_qv
Creator
Creator
Author

hi Sujeet,

i have one Field

MF_INCL

1

2

3

4

9

i am using set analysis as sum({<MF_INCL={'1','2'}>}GOAL) in pie chart

in the resultant pie chart i am getting 1,2 in the right side of the chart.

my requirement is instead of that numbers i want to display Low ,Mod(for 1,2)

Not applicable

Hi,

I think, we can solve this by using PICK and MATCH functions.

We could do this in two ways, either Script or Calculated dimension. See the attachment.

PICK(Match(MF_INCL, 1,2,3,4,5,6,7,8,9), 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine')

rathnam_qv
Creator
Creator
Author

Hi Venugopal,

Thanks for ur help..

can u explain me how the Pick nad Match Functions will work in this

Not applicable


Hi,

Simple defination:

Match() - It compares the string from a list of string values and return the position of matching text/vale. If not found then it can result the value 0.

Example:

Match(Var, 'Jan','Feb','Mar') - If Var value is "Feb" then the result is 2.

Pick() - This can return the expression value from the specific position in expression list.

Example:

Pick(2,'A','B','C') - result is B

I hope, you are clear now.

rathnam_qv
Creator
Creator
Author

Thanks Venu