Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all ,
i have years from 2000 to 2015 .Now i am trying to print years from 2005-2012 .How to do it with match() rather than hard coding the years from 2005-2012 .
Thanks
The Match() function can be used to compare strings, fields and variables using the string expression. The result of comparison is always an integer that shows the match expression. In the Match() function if no value is returned then the result would be 0. If an integer value is returned then the result would be 1. This function can used with the expression and it cannot be used with a chart, list box or text box. The Match() function will be used for a specified item in an array and then return the item in a specified position in a specified order. In the Match() the comparison is case sensitive.
Where to use Match() function
Hi,
See the attachment.
Thanks,
AS
The Match() function can be used to compare strings, fields and variables using the string expression. The result of comparison is always an integer that shows the match expression. In the Match() function if no value is returned then the result would be 0. If an integer value is returned then the result would be 1. This function can used with the expression and it cannot be used with a chart, list box or text box. The Match() function will be used for a specified item in an array and then return the item in a specified position in a specified order. In the Match() the comparison is case sensitive.
Where to use Match() function
This too can help you
The match function is a way to avoid writing
Load ...
From ...
Where Customer = 'A' or Customer ='B' or Customer='C'
and write it as
Load ...
From ...
Where match(Customer, 'A','B','C')
and it comes in a variety of flavors. WildMatch() is usually my favorite.
Hi,
Try like this
If(Year >= 2005 AND Year <= 2015), Year)
with Match() it is not possible with out hard coding.
Regards,
Jagan.
try like this
load
*
from sales .exl
where match (Year,'2005','2006','2007','2008','2009','2010','2011','2012','2013',2014','2015');
or
where not match(year,'2000','2001','2002','2003');
Hi,
Instead of Match() you can try this with simple less than and equal to options
R:
LOAD * Inline
[ Years
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014 ];
NoConcatenate
LOAD
Years
Resident R
Where Years >= 2005 and Years <= 2012;
Regards
Anand
Thank u all
Close this thread by giving correct and helpful answers.
Regards,
Jagan.
NoConcatenate
LOAD
Years
Resident R
Where Years >= 2005 and Years <= 2012;
After this, i think u need to drop table R as well