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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
midnight1
Contributor II
Contributor II

How to select Suppliers with only one specific code

I have a table with such columns:
Supplier_Id  |  Product_Id  |  block_code

suppliers have many different products and those products have different block codes. block-code = 0 means than you can buy this product, 1 means that there is no product in storage and 2 means that this products is no longer on sell.

I want to retrieve Supplier_id where every product has block_code = 2

I tried this:
=Only({[<Supplier_id = {"=Count({<block_code -={2}>}Product_Id  )=0"}>]}Supplier_id )

but this isn't working.

I am writing this in edit expression window while editing sheet.

Labels (4)
1 Solution

Accepted Solutions
TauseefKhan
Creator III
Creator III

Hi @midnight1,

Check this :
Aggr(
If(Count({<block_code -= {2}>} Product_Id) = 0, Supplier_Id),
Supplier_Id
)

View solution in original post

2 Replies
MatheusC
Specialist II
Specialist II

@midnight1 
try inserting the aggregation by Product_Id

=aggr(only({<block_code={2}>}Supplier_id),Product_Id)

- Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
TauseefKhan
Creator III
Creator III

Hi @midnight1,

Check this :
Aggr(
If(Count({<block_code -= {2}>} Product_Id) = 0, Supplier_Id),
Supplier_Id
)