Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Highest value of duplicate

Hi,

 

i have 3 columns column 1 is unique, column 3 and 4 can have duplicates.

 

Now i need to add a column to identify which has the highest value in column 1 when its a duplicate.

 

Example:

IndexIdName
1A21red
2A21red
3A22green
4A23yellow
5A22green
6A24blue
7A21red
8A22green
9A24blue

 

I need to have the higehst value marked with yes in a caalculated column 4

 

IndexIdNameHighest value
1A21redNo
2A21redNo
3A22greenNo
4A23yellowYes
5A22greenNo
6A24blueNo
7A21redYes
8A22greenYes
9A24blueYes

 

Any idea to solve it? Any help is welcome πŸ™‚

 

Regards

3 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Icon for Community Champion rankCommunity Champion

     

    Hi Anonymous ,

    Try this:

    Highest value = 
    
    var _curName = mycolor[Name]
    var _curIndex = mycolor[Index]
    var _calc = CALCULATE(MAX(mycolor[Index]),FILTER(ALLEXCEPT(mycolor,mycolor[Name]), mycolor[Name]=_curName))
    
    return IF(_calc = _curIndex, "Yes", "No")

     


    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
    Nathaniel

     

  • je_s's avatar
    je_s
    New Member

    My "index" column is not unique (it's actually a duration column counting stop time) - Is there a way to return one of the vaules? 

    example: Wrong

     

    Example: Correct

     

     

     

    • Nathaniel_C's avatar
      Nathaniel_C
      Icon for Community Champion rankCommunity Champion

      Hi je_s ,

      You will need some data that will differentiate which value to return if the values match - like the two values of 600.  You can either insert an index column, or I notice that your column has the word time in the header.  You could make a rule of taking the first or the last row based on the date by using the time value.


      Let me know if you have any questions.

      If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
      Nathaniel