3 Replies Latest reply on Nov 15, 2017 5:04 PM by Dan Cory

    Different results between a live and an extracted datasource

    Humberto Higuera

      Hello community

       

      I have a workbook published with a duplicated dashboard. The difference is that one is connected to a published extract that refreshes daily and the other uses a live connection. The idea is that users can quickly see results from yesterday and if they want to see the same view including today's data they use the live one,  knowing it is quite a bit slower (around two min to load).

       

      My problem is that one calculation is not giving the same result for the same formula in both cases. The formula with the problem is this:

       

      2017-11-14 11_51_27-Clipboard.png  2017-11-14 11_22_06-Dialog.png

       

      The formula is exactly the same in the extracted data source (left) and in the live data source (right). However, in the extracted data source the result is NULL and in the live data source the result is 0 !!

       

      2017-11-14 11_54_02-Tableau - RNA-Loads.png        2017-11-14 11_55_48-Tableau - RNA-Loads.png

       

      Of course I am positive that at the time I'm comparing the data is exactly the same. I exported both data sets from Tableau to confirm. The fact is that there is no records with status C nor D (there's only one record and the status field is NULL), I'd expect to get NULL as result which is what the extracted data source shows, but the live version is giving me zero as result. Not sure why it is different.  The same happens in the Server (published) and in the Desktop.

       

      Any idea why? Could this be a Tableau bug?

       

      I changed the formula version in the live version to this:

      2017-11-14 12_17_05-Dialog.png

       

      and now I see the same result in both!!  I'd really like to understand the reason for this, because this kind of different behavior makes me nervous because it seems you can not trust Tableau makes the same calculations in the live and in the extracted data sources.

       

      Sorry I can not publish the workbook because o the private nature of the data, but still to reproduce this you need to have a live connection.  BTW: I'm connecting to Oracle 12 using custom SQLs. Of course the SQL sentence is a replica in both the live and extracted data sources.

        • 1. Re: Different results between a live and an extracted datasource
          chris monger

          Hi Humberto,

           

          If I remember correctly, tableau extracts with a calculated field in will perform the calculation upon extract and act like the calculated field is part of the data.

          This might explain why you are seeing a null if there are null values in the fields you are using.

          Do you have instances of this that have a value other than 0, if so are you seeing the same issue for these? Also, are there any levels of aggregation set for the extract?

           

          If it is only instances of 0 this is happening for you could use zn() around the fields to make sure it doesn't bring a null in. If not I would suggest speaking to tableau support, unless anyone else on here has more details.

          • 2. Re: Different results between a live and an extracted datasource
            Humberto Higuera

            Thanks for your comment Chris.

             

            Yes, there are instances where the calculation is different than zero, and they work fine. The problem is only when the result is zero because there are no record that satisfy the criteria (status not C nor D)

             

            Unfortunately the ZN() you suggest wouldn't work in my case because what I actually need to know is when the result is NULL or zero:

            If there are not records that satisfy the criteria the I need NULL If there are records that satisfy it, then I need to get the result of the SUM... and this SUM could very well be zero or any other value.

            • 3. Re: Different results between a live and an extracted datasource
              Dan Cory

              We try hard to make all functions work the same on all databases, but there are cases where the database won't do what we want.

              I checked the Oracle documentation and it seems to say that this case should work.

              I tried to reproduce your problem and could not get the 0 behavior you see.

              So we'd need more details to see if there was anything we could change about this.

               

              Dan