Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello ,
I have a simple list box and added one field from a SQL database. On display, the box shows 3 rows ;
1
3
20
I would like to display BIRD instead of 1, CAT instead of 3 and DOG instead of 20 . Maybe I can use an expression ? Like match('1' , Fieldname, 'BIRD') or something ?
Hi,
Create Inline table
Write in script
* INLINE [
num, Value
1, Bird
3, Cat
20, Dog
];
Then use Value as List box
Or you can handle it on front end
create list box with expression
Like
if(wildmatch(num,'1'),Bird,if(wildmatch(num,'3'),'Cat',if(wildmatch(num,'20'),'Dog')))
Regards
Hi,
Create Inline table
Write in script
* INLINE [
num, Value
1, Bird
3, Cat
20, Dog
];
Then use Value as List box
Or you can handle it on front end
create list box with expression
Like
if(wildmatch(num,'1'),Bird,if(wildmatch(num,'3'),'Cat',if(wildmatch(num,'20'),'Dog')))
Regards
Hi,
Try this in script
LOAD
* ,
Pick(Match(num, 1, 2, 20), 'Bird', 'Cat', 'Dog') AS NewField
INLINE [
num
1
3
20
];
Hope this helps you.
Regards,
Jagan.
This was what I needed and it works :
if(wildmatch(num,'1'),'Bird',if(wildmatch(num,'3'),'Cat',if(wildmatch(num,'20'),'Dog')))
Many thanks @max dreamer
Hi,
Why using 3 ifs and 3 WildMatch(), simply use one WildMatch() and one Pick(), what if you have 50 number? will you include 50 If() and 50 WildMatch()?
=Pick(WildMatch(num, 1, 3, 20), 'Bird', 'Cat', 'Dog')
Hope this helps you.
Regards,
Jagan.
this is much easier , thanks jagan mohan