Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
yelin_nyu
Creator
Creator

labeling values in load statement

Hi there,

need help on labeling values. Currently in load statement I have a extremely long if statement: if (var='1' or var='x' or var='p' or ........., 'basic', 'special') so for each line within my main table, there is a value for var.

is there a way to make things shorter and more professional?

1 Solution

Accepted Solutions
MayilVahanan

HI

Try match function

Like

Load *, if(match(var,'1','x','p'),'basic','special') as fieldname from tablename;

Hope it helps'

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
its_anandrjs

Hi,

Use For loop for different stages calculation.

Regards,

Anand

yelin_nyu
Creator
Creator
Author

could you provide an example?

MayilVahanan

HI

Try match function

Like

Load *, if(match(var,'1','x','p'),'basic','special') as fieldname from tablename;

Hope it helps'

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
diegofcaivano
Partner - Creator
Partner - Creator

Hi. I believe you need the MATCH() function.

You can compare a unique expression with a list of values a lot easier:

MATCH($(VAR), '1', 'x', 'p', 'special', ...)

Look at QlikView's help description for more examples.

Regards.