Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Listbox with few fieldnames

Hi All,

I've 5 columns; I want only 2 columns to be visible in a listbox for selection.

Kindly guide!

Thanks,

Nikhil

1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

You can do it as below:

Say you have 4 fields like below and you want in the list box only two fields like ID and Region, then copy the below script and run it:

Data:
Load * Inline [
ID, Amount, Country, Region
10,100,A,APAC
20,200,B,APAC
30,300,C,NA
40,400,D,NA
50,500,E,Europe
]
;

Now create a list box and select Expression in the Field and paste the below expression:

=Pick(Match($Field ,'ID','Region'),'ID','Region')

Then you will see only two fields in the list box as below:

Hope this helps...

View solution in original post

7 Replies
Sergey_Shuklin
Specialist
Specialist

Hello, Nik!

Like this?

listbox.png

Not applicable
Author

In your example, I'd want the Listbox to have values A and B as list values if say we've A, B, C, D fields in data.

Anil_Babu_Samineni

May be this for List box expression, I am assuming you need only Column values. If not, Please elaborate little bit more

=If(Match(FieldName,'A','B'), Cod)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Untitled.png

I want only Channel_Name and Sales to be visible in this list box....

Hope the pic helps.

Right now,I've written =$Field in listbox expression right now to get all column names in listbox

trdandamudi
Master II
Master II

You can do it as below:

Say you have 4 fields like below and you want in the list box only two fields like ID and Region, then copy the below script and run it:

Data:
Load * Inline [
ID, Amount, Country, Region
10,100,A,APAC
20,200,B,APAC
30,300,C,NA
40,400,D,NA
50,500,E,Europe
]
;

Now create a list box and select Expression in the Field and paste the below expression:

=Pick(Match($Field ,'ID','Region'),'ID','Region')

Then you will see only two fields in the list box as below:

Hope this helps...

Not applicable
Author

Epic solution... truly genius!!!

Thank you Thirumala....

trdandamudi
Master II
Master II

You are welcome and I am glad to assist you...