Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

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.   

 

Single or Multiple Codes = IF(Flu_RMAs[RMA]=Flu_RMAs[Hdr Prob Code]="T1" && Flu_RMAs[Hdr Prob Code]="T2" || Flu_RMAs[Hdr Prob Code]="T3","Multiple","Single")
 
I tried something like this but it did not work. Any ideas are appreciated!

12 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak 

       

      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?

       

      • Anonymous's avatar
        Anonymous
        Not applicable
        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")
  • Anonymous's avatar
    Anonymous
    Not 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