Forum Discussion
Mulitple Conditions (at row level)
Hello - I have a situation where we have Orders that have different codes. Sometimes just one code. Sometimes multiple.
I would like to define a column that looks at each row, evaluating the RMA Order #, and see if there a header code (Hdr Prob Code). If there is then this counts as one header code.
If that RMA Order # repeats on another row....with a different Header Problem Code....then this RMA Order would be defined as having Multiple Header Codes. If it only had one, it would be defined as Single.
12 Replies
- amitchandak
Super User
Can you share sample data and sample output.
- AnonymousNot applicable
A simplified example of the source data would be (and the expected result in the last column)
RMA Order # Hdr Prob Code Single or Multiple
1234A T1 Multiple
1234A T2 Multiple
1234A T3 Multiple
3458A T1 Single
So, in this example, because RMA Order 1234A is listed three times, each with a different Header code, this Order would be defined as "Multiple".
Order 3458A only shows up once, with one Header code, and would be defined as Single.
Does that help?
- AnonymousNot applicableSingle or Multiple Codes = IF(CALCULATE(COUNTROWS(Flu_RMAs), FILTER(Flu_RMAs, Flu_RMAs[RMA Order #] = EARLIER(Flu_RMAs[RMA Order #])),FILTER(Flu_RMAs, Flu_RMAs[Hdr Prob Code] <> EARLIER(Flu_RMAs[Hdr Prob Code]))) > 1, "Multiple", "Single")
- AnonymousNot applicable
I don't know if I correctly understand your request but...
Single or Multiple Codes = IF(CALCULATE(COUNTROWS(Flu_RMAs), FILTER(Flu_RMAs, Flu_RMAs[RMA_Order] = EARLIER(Flu_RMAs[RMA_Order])),FILTER(Flu_RMAs, Flu_RMAs[Hdr Prob Code] <> EARLIER(Flu_RMAs[Hdr Prob Code]))) > 1, "Multiple", "Single")Change these with your variables:Flu_RMAs = Your table name
RMA_Order = RMA Order
Hdr Prob Code = Header Code