Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use the Match function?


Hi, I am trying to get the Match function to work, since I think it is a good way to solve my problem (if not, let me know!) I have a excelsheet like the one attached and tried with the expression as follows: 

=if(Match(NBR, Nbr)>0,sum(Sales),0)

My desired answer is the sum of sales for customer ABDF with matching number i.e 206, how can I get this to work?

Thanks in advance.

/Lina

1 Solution

Accepted Solutions
maxgro
MVP
MVP

dimension     Customer

expression     sum(if(NBR=Nbr,Sales))

DIRECTORY;

LOAD Customer,

     Nbr

FROM

TestMatch.xlsx

(ooxml, embedded labels, table is Sheet1);

LOAD Customer,

     NBR,

     Sales

FROM

TestMatch.xlsx

(ooxml, embedded labels, table is Sheet2)

View solution in original post

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

=if(Match(NBR, 'Nbr')>0,sum(Sales),0)


Simply Add ' char

MK_QSL
MVP
MVP

Something Like Below....

=if(Match([Customer Name],'ABC','DEF'), SUM(Sales))

=if(WildMatch([Customer Name],'*B*','*E*'), SUM(Sales))

Not applicable
Author

Thanks Alessandro, I got this to work if I write e.g 'YYY999', but not for the whole Nbr column. Maybe there is anothe function more suitable. The problem I want to solve is to know if the NBR coumn contains numbers that also is present in the Nbr column, and if there is a match I want to summarize the sales data for the one thet matches. Understandable?

alexandros17
Partner - Champion III
Partner - Champion III

Use WildMatch, look in the help section in Qlik

Then you can do something like:

Sum(if(wildmatch...), myVal, 0)

This will return the sum of elements that match

maxgro
MVP
MVP

dimension     Customer

expression     sum(if(NBR=Nbr,Sales))

DIRECTORY;

LOAD Customer,

     Nbr

FROM

TestMatch.xlsx

(ooxml, embedded labels, table is Sheet1);

LOAD Customer,

     NBR,

     Sales

FROM

TestMatch.xlsx

(ooxml, embedded labels, table is Sheet2)

MK_QSL
MVP
MVP

=If(Match(NBR, 'Nbr')>0 or isNUM(NBR), SUM(Sales),0)