Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to rename list box field value

hi

one of the fileld in my list box  has two names  in list box so i wantt two names to be treat asone.

suppose i have table

apple

banana

apple1 

now i want that apple 1 and apple comes underr single category.

18 Replies
its_anandrjs

Then change like

In place of this

If(Match(subhead,'MECHANICAL'),'Mechanical',table1) as NewField,


Use this

If(Match(subhead,'MECHANICAL'),'Mechanical',subhead) as NewField,


Syntax:-

If(Match(YourListFieldName,'apple1'),'apple',YourListFieldName) as NewField


If values changes you can make it dynamic by using different match function by using same syntax



its_anandrjs

For your script it would not work properly because you use wrong field you have to use [Sub-Head] other wise the same script you can use in another resident table.

////////////////////

     Head,

     [Sub-Head] as subhead,

     //System,

     //Equipment,

     //QTY,

     [Total Time(min)]as TOtaltime_MECH,

     [PM Duration Time (min)],

     If(Match([Sub-Head],'MECHANICAL'),'Mechanical',[Sub-Head]) as NewField,

     [Breakdown Time (min)]  as BRK_MECH,

     //Others,

     [Response Time (min)],

     [Serviceability (%)] as service1,

     [Availability (%)]as avail1

     //Remarks,

     //N

from

table1;

////////////////////////

Or

Temp:

Load

     Head,

     [Sub-Head] as subhead,

     //System,

     //Equipment,

     //QTY,

     [Total Time(min)]as TOtaltime_MECH,

     [PM Duration Time (min)],

     [Breakdown Time (min)]  as BRK_MECH,

     //Others,

     [Response Time (min)],

     [Serviceability (%)] as service1,

     [Availability (%)]as avail1

     //Remarks,

     //N

from table1;

Noconcatenate

Final:

Load

*, If(Match(subhead,'MECHANICAL'),'Mechanical',subhead) as NewField

Resident Temp;

Drop Table Temp;

Not applicable
Author

its throwing error  that field not found.

Subfield

its_anandrjs

Yes you are right you have to use

If(Match([Sub-Head],'MECHANICAL'),'Mechanical',[Sub-Head]) as NewField,

Not applicable
Author

ya its working but i want to merge them a single field so that in graph it will show as a one value

its_anandrjs

This will gives you single value but do not use previous field see the example.

LOAD *,If(Match(List,'apple1'),'apple',List) as NewField;

LOAD * Inline

[

List

apple

banana

apple1

];

List Fields gives you three values but NewField gives you only two fields

Not applicable
Author

could you plaese apply this on my script?

its_anandrjs

From  your given script you can use like

////////////////////

Load

     Head,

     [Sub-Head] as subhead,

     //System,

     //Equipment,

     //QTY,

     [Total Time(min)]as TOtaltime_MECH,

     [PM Duration Time (min)],

     If(Match([Sub-Head],'MECHANICAL'),'Mechanical',[Sub-Head]) as NewField,

     [Breakdown Time (min)]  as BRK_MECH,

     //Others,

     [Response Time (min)],

     [Serviceability (%)] as service1,

     [Availability (%)]as avail1

     //Remarks,

     //N

from

table1;

////////////////////////

Not applicable
Author

now i have another situation .

Head,

     [Sub-Head] as subhead,

     //System,

     //Equipment,

     //QTY,

     [Total Time(min)]as TOtaltime_MECH,

     [PM Duration Time (min)],

     If(Match(subhead,'MECHANICAL'),'Mechanical',table1) as NewField,

     [Breakdown Time (min)]  as BRK_MECH, 

     //Others,

     [Response Time (min)],

     [Serviceability (%)] as service1,

     [Availability (%)]as avail1 ,

     //Remarks,

     //N

from

table1;

concantanate

Head,

     [Sub-Head] as subhead,

     //System,

     //Equipment,

     //QTY,

     [Total Time(min)]as TOtaltime_MECH,

     [PM Duration Time (min)],

     If(Match(subhead,'MECHANICAL'),'Mechanical',table1) as NewField,

     [Breakdown Time (min)]  as BRK_MECH, 

     //Others,

     [Response Time (min)],

     [Serviceability (%)] as service1,

     [Availability (%)]as avail1 ,

     //Remarks,

     //N

from

table2;

concatenate

Head,

     [Sub-Head] as subhead,

     //System,

     //Equipment,

     //QTY,

     [Total Time(min)]as TOtaltime_MECH,

     [PM Duration Time (min)],

     If(Match(subhead,'MECHANICAL'),'Mechanical',table1) as NewField,

     [Breakdown Time (min)]  as BRK_MECH, 

     //Others,

     [Response Time (min)],

     [Serviceability (%)] as service1,

     [Availability (%)]as avail1 ,

     //Remarks,

     //N

from

table3;

now i have three similar type of table containing data of diff depatment . i want to plot graph on the dimension  of subhead that contain the value of department like electical , mech ,T1 respectively and i want to rename it and just want t1 as value.