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: 
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.

1 Solution

Accepted Solutions
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;

View solution in original post

18 Replies
Anonymous
Not applicable
Author

if(fieldname='apple1','apple',fieldname) into your list box expression.

maxgro
MVP
MVP

you can

- use an expression in your listbox

=if(yourfruitfield='apple1','apple',yourfruitfield)

- do the same thing in your load script

load

.....

if(yourfruitfield='apple1','apple',yourfruitfield) as yourfruitfield

....

from

....

its_anandrjs

Write like

=If(Match(ListField,'apple1'),'apple',List)

Or

In Load Script

If(Match(ListField,'apple1'),'apple',List) as NewField

Or

=If(ListField,'apple1','apple',List)

Or

In Load

If(ListField,'apple1','apple',List) as NewField

SunilChauhan
Champion II
Champion II

if (wildmatch(fieldname,'apple *','apple',Fieldname)

it will workd for all upper, lower  and capitalize cases

and also it will seach for all occurance start with apple or apple itself.

this is very useful i believe

Sunil Chauhan
Not applicable
Author

its not working

where should i exactly write this  script in load statement  and instead of list wat should i give?

its_anandrjs

In list box expression write like

=If(Match(YourListField,'apple1'),'apple',List)

Or in load Script add new field

Load

If(Match(ListField,'apple1'),'apple',List) as NewField

From Location;

See the snap

ListPro.png

SunilChauhan
Champion II
Champion II

why not check my post. i have  attched example

hope this helps

Sunil Chauhan
Not applicable
Author

Hi Yogita,

You can do this from script also. Use applymap function.

Map_Tab:

Mapping Load * Inline

[

Val, Reqd

apple1, Apple

Apple1, Apple

GreenApple, Apple

];

Now in your fact table use

applymap(Map_Tab,'Yourfield_Fruit','Val') as New_Fruit

In this way you won't get apple1 in your dashboard at all. You will get apple only and other measure as per apple(which is now apple1 or Apple1 or GreenApple etc)

Thanks & Regards

Suhas Gupta

Not applicable
Author

sorry but i want to change in backend ....

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;

just see  in subhead field there are two type APPLE and apple   but i want to plot it as one APPLE .so how should i do