Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

MAX FOR CUSTOMER

HELLO
I HAVE THE FOLLOWING SITUATION.

 

ABCDEFGH
Customer NumberCountry (0 = No Risky; 1= Risky)Index of payment2Rating (0 = A,B; 1= C,D,E,F, no rating)Insurance limit (0 = yes insurance; 1= no insurance)(B-A) > 0 is 1 <0 is 0:RISKY OVERDU Y is 1 empty is 02total rec on cl2
AE000011001100
AE000061001000
BE000110101110
BE000110101110
BE000350101110
BE002180101110
BE002180101110
BE002180101110
BE002970101100
BE003030101110
BE003960101110
BE003960101110
BE005680101010
BE005680101010
BE005680101010
BE005690101010
BE011550001000
CA000360101110
CA001100001100

 

I NEED A FORMULA THAT GIVE ME THE SUM OF COLUMN B-C-D-E-F-G BY CUSTOMER (FOR EXAMPLE TOTAL BE00568=3) AND THEN I NEED THAT THIS SUM IS DIVIDED FOR THE COUNTING OF ALL CUSTOMERS.

 

CAN YOU HELP ME ? 

  • USE THE SAME MEASURE 

     

    total = var total=SUM(Hoja5[B])+SUM(Hoja5[C])+SUM(Hoja5[D])+SUM(Hoja5[E])+SUM(Hoja5[F])+SUM(Hoja5[G])
    var cont=COUNT(Hoja5[A])    
    
    return
    DIVIDE(total;cont)

    here the result 


3 Replies

  • try this creat an index in the table and this measure.

     

    total = var total=SUM(Hoja5[B])+SUM(Hoja5[C])+SUM(Hoja5[D])+SUM(Hoja5[E])+SUM(Hoja5[F])+SUM(Hoja5[G])
    var cont=COUNT(Hoja5[A])    
    
    return
    DIVIDE(total;cont)

    • Anonymous's avatar
      Anonymous
      Not applicable

      i give another example

       

      yes

      for example i have these datas 

       

      A             B C D E F G H
      AE00001 1 0 0 1 1 0 0
      AE00006 1 0 0 1 0 0 0
      BE00011 0 1 0 1 1 1 0
      BE00011 0 1 0 1 1 1 0

       

      in my pivot i need a colum that give me BY customer MAX of the sum of all column B C D E F G H

      here the result 

      Customer Numbertotal
      AE000013
      AE000062
      BE000114

       

      and then i need another mesure that give me the SUM of this new column "TOTAL" dived by the number of the customer (in this case 9/3 

       

      thanks to all

      • santiagomur's avatar
        santiagomur
        Resolver II

        USE THE SAME MEASURE 

         

        total = var total=SUM(Hoja5[B])+SUM(Hoja5[C])+SUM(Hoja5[D])+SUM(Hoja5[E])+SUM(Hoja5[F])+SUM(Hoja5[G])
        var cont=COUNT(Hoja5[A])    
        
        return
        DIVIDE(total;cont)

        here the result