1 Reply Latest reply: Jun 20, 2014 2:20 PM by Bruno Souza RSS

    Make selection based on a set expression?

      Hi, all.

       

      I have a column of delta counts between two types of transactions that can happen in a session.  Basically, if a transaction is attempted 3 times and succeeds 1 time, the delta column for the given transaction will show 2 (3-1 = 2).

       

      I'm trying to add some functionality where a user can add a selection for all of the sessions that have delta > 0 by clicking a button.

       

      Basically, I've created a button, and I believe it needs a Select In Field action.  I've included the ID field selection to be set (expecting I'm going to fill it with a list of session IDs that had one of these deltas). 

       

      However, I'm stumped as to how to get a list of relevant IDs from a set analysis into my field selection.

       

      Is there something like this that I can put into my button to make the selection?

       

      SELECT({<$(=vDateAlias)={">=$(=vRangeDate1)<=$(=vRangeDate2)"}, delta_total={>0}>} [session_id]) //Would produce a list of IDs in the current selection that have a delta_total dimension greater than zero.


      Thanks!

        • Re: Make selection based on a set expression?
          Bruno Souza

          Hello, Eric.

           

          Do you really need the selection to be on session_id? If the selection is made on delta_total, the resulting subset will be the same. If you decide to select on delta_total, the search string is as simple as >0 .

           

          If you really want to select session_id, try this:

           

          ='(' & Concat(Distinct {<$(=vDateAlias)={">=$(=vRangeDate1)<=$(=vRangeDate2)"}, delta_total={>0}>} [session_id]), '|') & ')


          Regards.'