Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Manasareddy09
Contributor III
Contributor III

Check if the column value exists in another table column and count the number of times it exits

Hello all, 

this is my first time posting a question here on the community. 

I am currently working in SCM , 

I have two tables, one table with supplier information another with product information.

 

I need to check if the Id(in supplier table) matches with the Id(in product table) and count how many products are assigned with the same iD in product table. 

please let me know if anyone of you could help me with this. 

thank you, 

manu. 

Labels (2)
1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

I believe the ApplyMap will work for you.  The mapping table is a list of IDs with the number records in the Product table.  The ApplyMap function will check if the Supplier Information ID is in the mapping table and create a new column as ProductCount.

View solution in original post

5 Replies
jwjackso
Specialist III
Specialist III

I'll use the ApplyMap()  function

mapProductTable:

mapping

load ID,

          Count(ID) as ProductCount

From ProductTable group by ID;

 

SupplierInformation:

load ID,

          ApplyMap('mapProductTable',ID,0) as ProductCount

From SupplierInformation;

The 0 will indicate that the supplier id does not exist in the product table.

Manasareddy09
Contributor III
Contributor III
Author

 
Manasareddy09
Contributor III
Contributor III
Author

Hello sir,

Thank for replying me,

I have attached sample tables, The goal is not to check if the ID exists but to count how many of the same ID exists. 

the goal is to create a new column, called "Supp_Has_Product" which shows us how many products are assigned per one supplier. Every supplier has Unique ID, And in th products table there might be multiple same ID if the products come from the same supplier. 

So we need to check if the ID exists in the product table and also at the same time check how many products the are assigned.

Thank you for your time in advance.

jwjackso
Specialist III
Specialist III

I believe the ApplyMap will work for you.  The mapping table is a list of IDs with the number records in the Product table.  The ApplyMap function will check if the Supplier Information ID is in the mapping table and create a new column as ProductCount.

Manasareddy09
Contributor III
Contributor III
Author

Thank you so much , I will Definitely try this out 🙂 And comment again .

Community Browser