Forum Discussion

EZiamslow's avatar
EZiamslow
Helper III
2 years ago
Solved

Count every time status changes

Hi,
I need help with calculation every time tool status changes. I have many tool IDs set in the same table similar to the one below. What would be the best way to count where every time Availability column changes.

 

Sample Data Set:

 

ToolDateTimeAvailabilityCount
AA18/20/22 11:49 PMD1
AA18/20/22 10:08 PMU 
AA18/20/22 2:08 PMU 
AA18/19/22 7:11 PMD1
AA18/18/22 9:06 PMD 
AA18/18/22 8:15 PMU 
AA18/18/22 6:15 PMD1
BB18/20/22 11:08 PMD1
BB18/20/22 10:08 PMD 
BB18/20/22 6:45 PMU 
BB18/20/22 5:12 PMD1
BB18/20/22 2:08 PMU 
BB18/19/22 7:11 PMD1
BB18/18/22 9:06 PMU 
BB18/18/22 8:15 PMU 
BB18/18/22 6:15 PMD1

8 Replies

    • EZiamslow's avatar
      EZiamslow
      Helper III

      Ahmedx 

      ToolDateTimeAvailabilityCount
      AA18/20/22 11:49 PMD1
      AA18/20/22 10:08 PMU 
      AA18/20/22 2:08 PMU 
      AA18/19/22 7:11 PMD1
      AA18/18/22 9:06 PMD 
      AA18/18/22 8:15 PMU 
      AA18/18/22 6:15 PMD1
      BB18/20/22 11:08 PMD1
      BB18/20/22 10:08 PMD 
      BB18/20/22 6:45 PMU 
      BB18/20/22 5:12 PMD1
      BB18/20/22 2:08 PMU 
      BB18/19/22 7:11 PMD1
      BB18/18/22 9:06 PMU 
      BB18/18/22 8:15 PMU 
      BB18/18/22 6:15 PMD1

       

      Based on the sample above, I'd like to see AA1 = 3 and BB1 = 4.

      • Ahmedx's avatar
        Ahmedx
        Super User

        The logic of the calculation is not yet clear to me.
        tell me why these changes were not counted

    • EZiamslow's avatar
      EZiamslow
      Helper III

      It works but it's taking a long time to load 800k+ rows for the index column. Is there an alternative way to work on this?