Forum Discussion

BI-Geniuz's avatar
BI-Geniuz
Advocate I
6 years ago
Solved

Advanced Grouping in unstructered set - StringAggregation

Hi fellow BI-enthusiastics, I'm struggeling with a complex issue and hopefully someone can help me out. I'm trying to create groups based on a unstructed set that have some self defined events. ...
  • GetResponsive's avatar
    GetResponsive
    6 years ago

    Hi Nico,

     

    one solution could be to use (various) custom columns to get to unique identifiers.I have for testing purposes now split it into several columns, but most probably can be done in much more condensed way.

     

    1) Group Ind

     

    Group Ind =
    VAR PreviousRow =
    TOPN (
    1;
    FILTER (
    Blad1;
    Blad1[index] < EARLIER ( Blad1[index] )
     
    );
    [index]; DESC
    )
    VAR PreviousIndex =
    MINX ( PreviousRow; [index] )
    VAR PreviousExceeded =
    MINX ( PreviousRow; [exceeded_limit])
    RETURN
    IF(OR(AND(Blad1[exceeded_limit]<>BLANK();PreviousExceeded=BLANK());AND(Blad1[exceeded_limit]<>BLANK();PreviousExceeded<>BLANK()));1;0)
     
    2) New Group Ind
     
    New Group Ind =
    VAR PreviousRow =
    TOPN (
    1;
    FILTER (
    Blad1;
    Blad1[index] < EARLIER ( Blad1[index] )
     
    );
    [index]; DESC
    )
    VAR PreviousGroupInd =
    MINX ( PreviousRow; [Group Ind] )
    RETURN
    IF(AND(Blad1[Group Ind]=1;PreviousGroupInd=0);"Ja";"Nee")
     
    3) Group Number
    Group Number =
    10000+CALCULATE(COUNT(Blad1[New Group Ind]);FILTER(Blad1;Blad1[New Group Ind]="Ja");FILTER (Blad1;Blad1[index] <= EARLIER ( Blad1[index] )))
     
    4) Event Index
    Event Index = IF(Blad1[Group Ind]=1;Blad1[Group Number];Blad1[index])
     
     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Hope this helps

     

    BR

     

    Jeroen Heerschop

    Get Responsive