4 Replies Latest reply on Aug 4, 2017 9:10 AM by Robyn Sysavath

    Traffic to Views VS nviews in view_stats (PostgreSQL)?

    Robyn Sysavath

      This one might be a tricky one.


      Tableau has 2 sets of "views": 1) Traffic to Views (from Administrator view), and 2) nviews from view_stats (PostgreSQL) and also seen on the "views" on dashboard thumbnail.


      My question is what is the difference?


      Tableau's definition of nviews is: Keeps a cummulative count of the number of times the view was accessed by this user.


      Traffic to Views appears to be more precise in it's user access count by counting the number of times a user access a view and this is associated with a timestamp.


      Problem: when I roll up the entire count for "Traffic to Views", they differ from the nviews (see screenshots below).


      I tried searching the forums, but I constantly get the basic definition for each or descriptions that are somewhere along the lines:

      • traffic to views = count based on historical_event timestamped log based the event that a user accesses the view
      • nviews = cumulative count of the number of times users accessed the view rolled up to Last View Time


      What would make them differ in total counts? My nviews for all my workbooks would always be a lot larger in count than my traffic to views.


      Note: Traffic to Views is opened up to all years.


      The total roll up for the workbook is 192

      traffic to views opened up to all years.jpg


      The total roll up for the workbook is 450



      I will be eternally grateful to anyone who can help me with this! It's been driving me nuts




      Robyn Sysavath

        • 1. Re: Traffic to Views VS nviews in view_stats (PostgreSQL)?
          Luke Brady

          Robyn, I've done some analysis on this.  I think the difference is because of the filters on the Traffic to Views tab of that Dashboard.  When I look at a Workbook created this year - the numbers match.  When I switch to an older Workbook the numbers don't.  This is while I am filtering on Current Year (and min View Count is 0).


          In short the numbers match but not for the filters you are using?


          I've compiled a list of Postgres Joins you may find useful in the future for these types of questions or if you want to write more of your own custom queries:

          Tableau-Server-Postgres-Queries/Tableau_Server_Tables_Fields_Joins.sql at master · isajediknight/Tableau-Server-Postgres…

          • 2. Re: Traffic to Views VS nviews in view_stats (PostgreSQL)?
            Robyn Sysavath

            Thanks Luke for taking the time to answer my question!


            I'm not sure I understand what you mean about the filters I am using. Do you mean the year Time Range filter? I noted that I used "all years" (we only had Tableau for around 2.5 years?)  (see screenshot below).

            Traffic to Views.jpg

            Shouldn't the view count account for all years if the time/date range includes all the years we have had Tableau? Or are you saying it will only be correct for the current year only.



            I also used the Tables in the PostgreSQL database to construct custom views and was able to replicate the numbers that Tableau gave in it's prebuilt Administrator "Traffic to Views" and view_stats table. (screenshot below).


            Note that "Views" = traffic to views (historical tables) and "Looks" = nViews from view_stats table. I got that "Looks" terminology from the forums... I forget where. But the years for both are wide open.

            Views and Looks.jpg


            I think I might be missing something here. Perhaps updating views or adding more sheets to views affects the counts? ---I'm trying to test all of that with my "Compare Views and Looks" dashboard on a NEW clean workbook (see screenshot below).

            Traffic to Views NEW.jpg

            But the numbers always come up the same no matter how I enter the views, activate tabs and enter tabbed views, etc.


            I really appreciate your help with this Luke! I'll try to hunt down and test some of those table joins in your SQL query and see if they produce different results. It looks like you're using the same tables, but perhaps the joins differ. I'll let you know if I find anything exciting!


            Thanks again!


            Robyn S.

            • 3. Re: Traffic to Views VS nviews in view_stats (PostgreSQL)?
              Damien Lesage



              The historical_tables has a 6-month retention by default (see parameter wgserver.audit_history_expiration_days in tabadmin set page tabadmin set options).

              The nviews corresponds to the lifetime cumulative value of the views (i.e. from first publish).


              This might explain your differences.



              1 of 1 people found this helpful