5 Replies Latest reply: Jan 19, 2016 5:12 PM by Stefan Wühl

# Set Analysis - One field equal but the other is not

Hey!

I want to create a set analysis that sums "Extended Cost" IF "Document Type" does not equal "Document Type" AND "Lot Number" EQUALS "Lot Number"

Thank you!

• ###### Re: Set Analysis - One field equal but the other is not

Document Type does not equal Document Type? Not sure I understand can you elaborate?

• ###### Re: Set Analysis - One field equal but the other is not

This is all one table.

IF two items have the same lot number and the document type does not match (i.e. one is "IF" the other "RM"), I want to sum the extended amount by lot number.

Make sense?

 Document Type Document Number Batch NDC number Description Lot number Transaction Quantity Unit Cost Extended Amount Gl Date IF 6456 23432 2 ABC 4 -50 0.3401 -17.01 1/13/2014 RM 3234 658 1 CDE 5 10 0.22 15 1/13/2014
• ###### Re: Set Analysis - One field equal but the other is not

In your sample, lot numbers differ. What do you want to do in this case?

Could you explain your requirements a bit more detailed?

What if Lot number is the same AND Document Type match? What if you have more than two records with different combinations of matching patterns?

• ###### Re: Set Analysis - One field equal but the other is not

I only want to include those where the Lot number match and the document type do not match.

• ###### Re: Set Analysis - One field equal but the other is not

Maybe something like

Sum({<[Lot number] = {"=Count(Distinct [Document Type])>1"} >} [Extended Amount])