Forum Discussion

aviral's avatar
aviral
Icon for Advocate IV rankAdvocate IV
8 years ago
Solved

Rows aggregation based on various criteria

*This is not a question   Would like to share recent learning that I had related to one of the issues that I was facing while trying to aggregate data. There are multiple posts available which gave...
  • Anonymous's avatar
    Anonymous
    8 years ago

    aviral,

    Alternatively, you can perform the following steps to get target table.

    1. Duplicate the Timestamp column in Query Editor, then split the duplicated column by +.


    2. Remove Timestamp – Copy1 column and rename Timestamp -Copy2 column to interval.


    3. Create the following calculated columns in the table.

    Column = IF(Table[Interval]=BLANK(),0,Table[Interval])


    Index = RANKX(FILTER(Table,Table[Call Identifier]=EARLIER(Table[Call Identifier])),Table[Column],,ASC,Dense)

    Difference = var previous=CALCULATE(FIRSTNONBLANK(Table[Status],Table[Status]),FILTER(Table,Table[Call Identifier]=EARLIER(Table[Call Identifier])&& Table[Index]=EARLIER(Table[Index])-1)) return IF(ISBLANK(previous)||previous<>Table[Status],1,0)

    4. Drag Difference column to Visual Level filters of the table visual and set its value to 1.


    Regards,
    Lydia