Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

match function in qlikview

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

1 Solution

Accepted Solutions
Highlighted
Master III
Master III

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

  • The Match() function can be used in a QlikView application for the "Switch Case" statement.
  • It can be also used as a substitution in an If statement.
  • It can be used in a Load Script as an In statement.
  • It can be used to find a match without using the duplicate value.

View solution in original post

12 Replies
Highlighted
Master III
Master III

Hi,

See the attachment.

Thanks,
AS

Highlighted
Master III
Master III

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

  • The Match() function can be used in a QlikView application for the "Switch Case" statement.
  • It can be also used as a substitution in an If statement.
  • It can be used in a Load Script as an In statement.
  • It can be used to find a match without using the duplicate value.

View solution in original post

Highlighted
Master III
Master III

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.

Highlighted
MVP & Luminary
MVP & Luminary

Hi,

Try like this

If(Year >= 2005 AND Year <= 2015), Year)

with Match() it is not possible with out hard coding.

Regards,

Jagan.

Highlighted
Not applicable

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');

Highlighted

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

Highlighted
Specialist
Specialist

Thank u all

Highlighted
MVP & Luminary
MVP & Luminary

Close this thread by giving correct and helpful answers.

Regards,

Jagan.

Highlighted
Master
Master

NoConcatenate

LOAD

Years

Resident R

Where Years >= 2005 and Years <= 2012;

After this, i think u need  to drop table R as well