Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

List Box Edits

Is there a way to change a value in a list box?,For example, I have a list box where the value is apple but I want it to read Granny Apple and when you filter on Granny Apple results from Apple should appear in your table box, is that possibe?

If not, I can make these edits in the script but I will need help

List Box

Apple

Banana

Orange

Results:

List Box

Granny Apple

Banana

Orange

//Script syntax:

Apple:

SQL

xxxxxxxxxxxxxx

Distinct:

SQL

xxxxxxxxxxxxxx

Final Table:

inner join (Apple)

Load

Columns from Distinct

Resident [Distinct]

Drop table [Distinct]

Where would I make edits to the Apple table , would I have to create a separate load statement for Apple?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Alternatively you can create the expression in the listbox itself.  If(Field like 'Apple', 'Granny Apple', Field)

View solution in original post

8 Replies
maxgro
MVP
MVP

maybe adding a field (NewField)

source:

load * inline [

Field, Value

Apple, 1

Banana, 2

Orange, 3

];

left join (source)

load *,

if(Field='Apple', 'Granny Apple', Field) as NewField

Resident source;

Anonymous
Not applicable
Author

Alternatively you can create the expression in the listbox itself.  If(Field like 'Apple', 'Granny Apple', Field)

Anonymous
Not applicable
Author

Exactly what I was looking for, thanks.

Not applicable
Author

hi.

try this

if(Field='Apple', 'Granny Apple', Field) as NewField

Anonymous
Not applicable
Author

How many IF statements can one have in the list box expression?

Anonymous
Not applicable
Author

The reason I ask, I have a table below: 45 different columns that need to be added into a list box

ID Apply  Banana  Orange XXX     xxx     xxxx     xxx     xxx

1     x          x                                        x          x                   

2                                   x                                   x               x

3

4

5 x               x                    x

6...Thds of records

shanemichelon
Partner - Creator II
Partner - Creator II

It sounds like you really do need to modify your script to include a lookup type table.  Effectively you need a dimension table to get the names.

So let us say that your data load script leaves you with a table like this:

IDFruitPriceQty
1Bananna102
2Apple153
3Pear185

Use inline script to add another table like this:

FruitFruitLongName
BanannaBig Yellow Bannanna
AppleGranny Smith Apple
PearNice Pear

The common field name 'Fruit' will join the tables.  Then in your list just use FruitLongName.

The load script for the dimension table would look like this:

Load * Inline [

Fruit, FruitLongName

Bannanna,Big Yellow Bannanna

Apple,Granny Smith Apple

Pear, Nice Pear

]

From what you have said it seems like you need to present this in a straight table rather than a list box.

remember that in Qlikview, you can select on the field in the table, it doesn't have to be a listbox.