Forum Discussion

Birdie's avatar
Birdie
Regular Visitor
6 years ago
Solved

Calculate a value based on values in same column

Hi all, I hope this is a simple request. I have 3 columns of data: 1. Date/time - 10 second intervals 2. Value - integers increasing 3. Index - starts at zero and increases   It looks like this:...
  • Greg_Deckler's avatar
    6 years ago

    So, as a calculated column you could do this:

     

    Column = 
    VAR __index = [Index]
    VAR __index30 = [Index] - 3
    RETURN IF(__index30 < 0,BLANK(),
        VAR __value = [Value]
        VAR __value30 = MAXX(FILTER(ALL(bottles),[Index] = __index30),[Value])
        RETURN (__value - __value30) * 2
    )