1 Reply Latest reply: Oct 28, 2016 1:20 PM by John Witherspoon RSS

    Counting entries of key values

    Håkon Trømborg

      Hi,

      I have two tables

       

      Presence

       

       

      DateUser

      Presence

      111
      120
      211
      221

      and

       

      Journal entries

      DateUserSomeValue
      11Some
      21Things

       

      The Presence table is there to give information about which journal entries should be taken into consideration in certain aggregations. 'Active' users are indicated by a 1 in the Present-field.

      Some Users were not "active" at certain points in time, and so the average entries/users should not take these into consideration for these dates.

       

      In particular, I'm looking to calculate the average of[ (users who used the journal on a date)/(active users on that date) ] over all dates.

       

      My first strategy was to do ( Count Distinct Journal entries.User ) / ( { < Presence = {0} > } Count Distinct Presence.User )

      However, this doesn't seem to give the desired outcome.

       

      Is there a simple way to access only the Users that are present in one of the tables?