1 Reply Latest reply on Oct 3, 2016 3:41 PM by hannah.johnson

    Need help creating calculated fields...

    M Panda

      Hello,

       

      Below is a screen shot of the "events" I have.  For every ad id there is a series of events that occurs.  I basically need to isolate for three different sets of events (below).  Everything that does not fall into the three sets of events, I want to just disregard.

       

      Can someone help me set up calculated fields for every ad id that has these three events?

       

      No background event:

      • display_complete – 10000ms
      • dismissed – 20000ms

      Calculation: (dismissed - display_complete)

       

      Background Event Occurred, and the Listener Returned:

      • display_complete – 10000ms
      • visibility_lost – 12000ms
      • visibility_gained – 15000ms
      • dismissed – 20000ms

      Calculation: time_in_view = time until dismiss (dismissed - display complete) - time out of view (visibility gained - visibility lost)

       

      Background Event Occurred, but Listener Never Returned:

      • display_complete – 10000ms
      • visibility_lost – 12000ms
      • dismissed – 20000ms

      Calculation: visibility_lost - (dismissed - display_complete)

       

      2016-09-29 10.24.39 am.png

        • 1. Re: Need help creating calculated fields...
          hannah.johnson

          Hi there,

           

          A FIXED level of detail expression will be most helpful to find the values of those three calculations. FIXED level of detail expressions compute a value using the specified dimensions, without reference to the dimensions in the view.  In this case, the FIXED level of detail expression will specify which level of detail to compute the values at.

           

          The first measure, Calculation: (dismissed - display_complete), will look like the following:

           

          { FIXED [Line ID], [Ad Correlation Id] : SUM(IF [Event] = "dismissed" THEN [Elapsed Time] END)} -

          { FIXED [Line ID], [Ad Correlation Id] : SUM(IF [Event] = "display_complete" THEN [Elapsed Time] END)}

           

          So for every Ad Id in every Line Id, find the value of the event "dismissed" and subtract the value of the event "display_complete". The other two measures will fall along the same lines and use FIXED level of detail expressions as well.

           

          Additional information about FIXED level of detail expressions can be found here:

          http://onlinehelp.tableau.com/current/pro/desktop/en-us/help.htm#calculations_calculatedfields_lod_fixed.html

           

          Hope that helps!

           

          Cheers,

          Hannah