Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Comparing Two FieldsUsing Set Analysis

Hi all,

I am a beginner to QV so forgive me if this is a simple solution.

I need to use 4 fields with this chart:

MASTER: the number identifying a set of components

COMP: the number identifying the component

QTY: the amount of each component we have in stock

RQTY: the required number of a component needed to make the set

I need to know for each MASTER, whether we have enough stock of each component to make a full set.

The expression I am using right now is the following:

If(count({$<[QTY] = {">=$([RQTY])"}>}[SKU]) = count(SKU), 'Yes', 'No')

However this isn't fully working properly. If we are completely out of stock in a component then it works properly, but when we have stock, but less than the required it outputs 'Yes' instead of 'No'. Does anyone know how I should write the Set Analysis so it catches this properly?

Best,

Kevin

6 Replies
sunny_talwar

Would you be able to share few rows of data with the expected output from the sample data provided?

Anonymous
Not applicable
Author

sorry the name of the components are SKU, not COMP

Anonymous
Not applicable
Author

Here are the two sample input tables:

SKUQTY
12341
23455
34560
45672
5678

1

MASTERSKURQTY
98712341
98723452
98745671
87656782
76534564
76512341

And the desired output:

MASTERCreatable?
987Yes
876No
765No
sunny_talwar

May be this

If(Sum(QTY) > Sum(RQTY), 'Yes', 'No')

Anonymous
Not applicable
Author

This doesn't work, this will sum the quantities of all the components and compare it to the sum of all the required quantities. I need it to look at each SKU individually. I am pretty sure you need set analysis to do this.

sunny_talwar

Your two tables already join on SKU... are they not?