6 Replies Latest reply: Sep 12, 2018 9:14 AM by youssef belloum RSS

    Sort by expression dimension with expression

    Gal Polak

      Hi,

      I know that we should try to include all logic in the script side and not in the UI,

      but unfortunately in this case i needed to create a dimension with expression.

       

      and this is my dimension:

      if(

      aggr(Sum({$<$(=if(WildMatch(GetFieldSelections(_UserFilters), '*Show Hidden Users*'),'DisplayInLeaderboard=','DisplayInLeaderboard={1}')),

      $(=if(WildMatch(GetFieldSelections(_UserFilters), '*Show Inactive Users*'),'IsActive=','IsActive={1}')), WasLoginPotential={1},[Property Name]=>}WasLoggedIn),UserID)<5,'Low (<5)',


      if(

      aggr(Sum({$<$(=if(WildMatch(GetFieldSelections(_UserFilters), '*Show Hidden Users*'),'DisplayInLeaderboard=','DisplayInLeaderboard={1}')),

      $(=if(WildMatch(GetFieldSelections(_UserFilters), '*Show Inactive Users*'),'IsActive=','IsActive={1}')), WasLoginPotential={1},[Property Name]=>}WasLoggedIn),UserID)<15

              AND

              aggr(Sum({$<$(=if(WildMatch(GetFieldSelections(_UserFilters), '*Show Hidden Users*'),'DisplayInLeaderboard=','DisplayInLeaderboard={1}')),

      $(=if(WildMatch(GetFieldSelections(_UserFilters), '*Show Inactive Users*'),'IsActive=','IsActive={1}')), WasLoginPotential={1},[Property Name]=>}WasLoggedIn),UserID)>5,'Medium',

             

                  if(aggr(Sum({$<$(=if(WildMatch(GetFieldSelections(_UserFilters), '*Show Hidden Users*'),'DisplayInLeaderboard=','DisplayInLeaderboard={1}')),

      $(=if(WildMatch(GetFieldSelections(_UserFilters), '*Show Inactive Users*'),'IsActive=','IsActive={1}')), WasLoginPotential={1},[Property Name]=>}WasLoggedIn),UserID)>15,'High (>15)'

                  )

              )


      )



      as you can see from this dimension i get 3 values:

      1. Low (<5)

      2. Medium

      3. High (>15)


      all i want to do is present it in bar chart in the following order:

      High, Medium, Low


      but how do i do it with "Sort by expression?"